uwhpsc-2016 / homework1

Homework #1
1 stars 1 forks source link

When do `malloc()` and `free()` invoke an OS system-call? #40

Open afarahatoutset opened 8 years ago

afarahatoutset commented 8 years ago

My understanding of the way that malloc() and free() work is that they operate on a global compile-time memory pool (which we call the heap) allocated by their library implementation. I am not sure how to track whether malloc() invokes a system call to "extend the size of the heap" from OS, or just declares failure.

What system call would it invoke for Linux?

How would the OS guarantee that the requested heap block is contiguous with whatever heap was allocated initially?

cswiercz commented 8 years ago

Moved to uwhpsc-2016/lectures#2