GLIB/GTree memory deallocation



Hello,

hope this is the right conference:

I have a problem with (especially) GTrees, as with the rest of GLIB, I
need to have large B trees  with small nodes. Problem is that after
correct deallocation of the tree (I hope) the memory useed by tree itself
is not given back to os. Also the g_mallocated memory is not given back to
os after g_freeing. Is there some way to change the allocation routine
within glib itself? I've heard about some zone allocation techniques -
that should glib do internally, but why are trees then created like thios?

gtree.c:

    if (!node_mem_chunk)
        node_mem_chunk = g_mem_chunk_new ("GLib GTreeNode shit chunk",
                                          sizeof (GTreeNode),
                                          1024,
                                          G_ALLOC_ONLY);
                                         ^^^^^^^^^^^^^

If I try to change G_ALLOC_ONLY to G_ALLOC_AND_FREE my program stops at
some neverending loop inside glib.

My configuration is glib-1.2.3, linux 2.0.36, libc 5.4.44,
egcs 1.0.3 as well as gcc 2.7.2.3

If you respond please Cc: to my mail address also.

Vladimir

------------------------------------------------------------------
 Vladimir Myslik  
(if you experience delivery problems replying my mail, try the addresses below)
xmyslik@cslab.felk.cvut.cz , xmyslik@cs.felk.cvut.cz
http://cs.felk.cvut.cz/~xmyslik/



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