2026-10-14 17:28 UTC
Advanced Programming in the #UNIX Environment
Tool Tip: sizeof != strlen
Since we just had some fun with gdb(1) and looking at strings, let's also quickly discuss how the "sizeof" operator differs fundamentally from the "strlen(3)" library function and why it is important to not confuse the two.
Preparing this video then made me write the manual page for sizeof now shipped with #FreeBSD: https://man.freebsd.org/cgi/man.cgi?query=sizeof
https://youtu.be/FyPqII2rewA?si=srSzuVrryTyPyVXl
Replies (3)
-
@jschauma@mstdn.social 2026-10-15 14:09
Advanced Programming in the #UNIX Environment Week 6: Memory Layout of a Process In this video lecture, we are trying to get a visual understanding of what a process looks like in memory. We create a program that prints out the addresses of different elements of a program and observe the alignment of the text, data, and bss segments as well as the placement of the heap and stack. We also illustrate what a stack overflow looks like. https://youtu.be/aHmcowhoOzU
-
@screwlisp@gamerplus.org 2026-10-14 17:38
@jschauma@mstdn.social ha, ha, ha.
-
@odc@mstdn.io 2026-10-15 10:28
@jschauma@mstdn.social Very nice man page!