Re: [Glib Internals] Request for help: a brief explaination of gmem's design



On Mon, 2004-01-05 at 13:34, Owen Taylor wrote:
> On Mon, 2004-01-05 at 15:25, Ryan McDougall wrote:
> > On Mon, 2004-01-05 at 11:56, Owen Taylor wrote:
> > > 
> > >  - All areas are the same size
> > >  - The tree's only purpose is to map from atom to the area holding
> > >    the atom. Which atoms are in use is tracked by the free_atoms
> > >    list in the GMemChunk and the various fields of GMemArea.
> > > 
> > > Regards,
> > > 						Owen
> > > 
> > Thanks!! I'm almost clear on this, but what is the purpose of an Area?
> > Its not for arrays then?
> 
> The point is that by allocating the atoms in groups you save
> calls to malloc() and save per-block malloc overhead.
> 
> (Note that alloc-and-free memchunks perform worse than malloc()
> on today's systems...)
> 
> Regards,
> 				Owen
> 

Hate to keep bothering you, but this stuff is *gold*. So Areas are fixed
size, kinda like pre-caching to save the context switch in malloc,
however if your allocs exceed the Area, GMemChunk will automatically
allocate more Areas?

Do you have any performance data I can see? I'll google for it right
now...

Like I said before, Im mostly interested in the Whys (I can figure out
the Hows).

Cheers,
Ryan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]