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
How can you restore a redirected standard stream?
What is #define used for in c?
Who developed c language?
What are the characteristics of arrays in c?
What is the difference between new and malloc functions?
In which header file is the null macro defined?
What is hashing in c?
What are shell structures used for?
Explain what standard functions are available to manipulate strings?
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
How can I remove the trailing spaces from a string?
What is pre-emptive data structure and explain it with example?
What are the application of c?
Write a program to reverse a given number in c?
what will be maximum number of comparisons when number of elements are given?