Re: Regarding brk and sbrk
venkat wrote:
>
> Hi folks,
>
> Can some in understanding brk and sbrk. how does these are
> implemeted(means how the memeory will be allocated). How malloc will
> call these brk and sbrk. Please also give any example C program, where
> brk and sbrk are used to allocate memory.
In chapter 8 of The C Programming Language, there is
an example of a general purpose storage allocator function.
The general purpose storage allocator function,
calls a function named morecore.
The definition of morecore, shows a call to sbrk.
--
pete
|