Task: Modifying Memory Region Size
Navigate to the labs/lab-04/tasks/modify-areas/support directory.
-
Comment out different parts of the
hello.cprogram to notice differences in only specific areas (text, data, bss, heap, stack). -
Use a different argument (
order) for the call to thealloc_stack()function. See how it affects the stack size during runtime (investigate withpmap). -
Do a static build of
hello.cand check the size of the memory areas, both statically and dynamically. -
The
extend_mem_area.pyPython script allocates a new string at each step by merging the two previous versions. Start the program and investigate the resulting process at each allocation step. Notice which memory area is updated and explain why.
If you’re having difficulties solving this exercise, go through this reading material.