Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is mallloc()?how it works?

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


Please Help Members By Posting Answers For Below Questions

Why array is used in c?

968


What is sorting in c plus plus?

923


What is a struct c#?

998


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1047


What are global variables and explain how do you declare them?

1029


Differentiate between the expression “++a” and “a++”?

1200


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

1013


What does c mean in standard form?

1096


Describe dynamic data structure in c programming language?

1036


How will you declare an array of three function pointers where each function receives two ints and returns a float?

1289


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

1052


What is the use of a static variable in c?

1006


What is the hardest programming language?

1094


What is context in c?

881


What does struct node * mean?

964