On Tue, Mar 26, 2002 at 04:09:52PM +0000, Waider wrote:
> According to Waider:
> > Isn't this kinda what brk or sbrk does?
no, brk and sbrk are what malloc uses to increase the heap for a process
if it can't find space on its free list.
> Maybe it isn't, quite. calloc() on the other hand is pretty close.
no, that's not the same idea. first it allocates chunks of the same size.
second, it returns a pointer. i just want to know the memory is now
reserved, i could care less where it is.
essentially i'd like a way to tell the guts of malloc (w/o really
touching them) to reserve the memory - including the memory it needs to
do accounting for all the calls i'm going to make.
malloc_reserve would then make sure there was room on the heap for that
amount of memory. it might make calls to sbrk/brk for that space, it
might just see that the space exists in it's free list. whichever method
it needs to reserve the space, it does it.
the normal way of doing this on an application level is to call
malloc yourself for a big chunk of memory and then manage it yourself.
however glibc functions that call malloc still need to be checked.
plus, malloc is already managing memory, why duplicate that code?
kevin at suberic.net buffy: come on, can't you put your foot down?!
fork()'ed on 37058400 giles: it *is* down.
meatspace place: orbit buffy: one of these days you're going to have to
http://suberic.net/~kevin get a grown up car. --inca mummy girl
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!