Re: hackerlab fsplay.[ch] status
Tom Lord <lord-1tv/[email protected]> Thu, 6 May 2004 12:36:54 -0700 (PDT)
| Newsgroups | gmane.lisp.scheme.pika.devel |
|---|---|
| Message-ID | <[email protected]> |
> From: Andreas Rottmann <[email protected]>
> I've started porting the GLib memchunk implementationn to
> hackerlab.
Why?
This code bugs me a little bit. It seems to me that in the common
case it will be doing nothing that the underlying malloc won't already
be doing, probably better.
I can understand using free-lists of particular data structures from
time to time -- but this goes further than that, attempting to return
memory to the general store when it can. That's a job for malloc.
If anything, I would expect using something like memchunks to (most of
the time) increase fragmentation. The reason is that separate
memchunks will be allocated for each distinct _type_ being allocated
from memchunks, whereas with malloc, chunks will be allocated only for
each distinct (rounded) _size_. There are only a couple different
(from the allocator perspective) common sizes of things that are
heavily allocated and deallocated even though there many be many
different types having those sizes.
What's the case for having this facility?
-t