LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Re: thoughts on malloc...

[ILUG] Re: thoughts on malloc...

kevin lyda kevin at ie.suberic.net
Wed Mar 27 18:38:44 GMT 2002


On Wed, Mar 27, 2002 at 10:52:40AM +0000, John P. Looney wrote:
>  I may be wrong, but I don't think there is just a table, as such. when
> you do;

uh, i think i said exactly that in the message you replied to.
regardless, it's implementation dependant and you can't depend how
it's done.

>  As unix people, we should really know exactly how this works. Anyone care
> to explain ?

no, you shouldn't care how it works.  it's libc dependant.  which means
that unless you're implementing libc, leave it alone.

On Wed, Mar 27, 2002 at 10:35:10AM +0000, Nick Murtagh wrote:
> But would the "reserve" call actually allocate the memory? If not, you'll
> still have to check the return from every malloc, and do all the messy
> stuff with free!

yes, it would reserve memory.  and so yes, there's the chance for a
memory leak.  the unreserve call will unallocate any memory not used
from the matching reserve call.  so if you malloc_reserve 1024 bytes
and then only use 100 bytes, the matching unreserve call would remove
the reserveation for the remaining 924 bytes.

btw, in reading the info pages on glibc it might be possible to mimic
this functionality with either malloc hooks, free hooks or with mallopt.
all of these are glibc specific however.  it's too bad libc is so cast
in stone - be nice if there was a c equiv to cpan.

kevin

-- 
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




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell