DSA Studio
Search
Home
Sign in
Memory Fundamentals Quiz
Test understanding of heap memory and sbrk
1. What does sbrk(0) return?
The current program break (end of heap)
NULL on all systems
The start of the heap
The amount of free memory
2. Why can't we simply use sbrk(-n) to return memory to the OS after every free()?
sbrk only works with positive values
Memory in the middle of the heap cannot be returned
The kernel ignores negative sbrk values
It would be too slow
Submit quiz
Auto-advance on pass