Answer Posted / raghavan
Every process has a address boundary. When a process does a malloc, memory is allocated from this boundary location and the process address boundary is moved to the new end. In linux, there is a function sbrk() that allows to change the process address boundary. sbrk(0) will return the current process address boundary and sbrk(n) will move the process boundary by n bytes.
malloc internally uses this feature to allocate memory for the requesting process.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Why dont c comments nest?
What is the purpose of type declarations?
why we wont use '&' sing in aceesing the string using scanf
Is python a c language?
What is difference between function overloading and operator overloading?
If fflush wont work, what can I use to flush input?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
How to create struct variables?
What is pre-emptive data structure and explain it with example?
What is a spanning Tree?
What are the functions to open and close file in c language?
What is c preprocessor mean?
When should the register modifier be used? Does it really help?