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 array is used in c?
What is sorting in c plus plus?
What is a struct c#?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
What are global variables and explain how do you declare them?
Differentiate between the expression “++a” and “a++”?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
What does c mean in standard form?
Describe dynamic data structure in c programming language?
How will you declare an array of three function pointers where each function receives two ints and returns a float?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
What is the use of a static variable in c?
What is the hardest programming language?
What is context in c?
What does struct node * mean?