Re: Use of Memory Slices in N-ary Trees

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

 



Hello.

> Ok I understand that its using g_slice_new0, but does this mean that it does
> it just for a single GNode, one at a time?
> What I was after was more like say being able to allocate 100 such GNodes at
> a time upfront if I had a tree with say 5000 nodes in it or something, so I
> am able to get a whole chunk of GNodes at the one time!
> Maybe I am misunderstanding something?

It does allocates single node when calling g_node_new() and there is
no way to preallocate memory. But you should not need this, since
slice allocator takes care of making sure memory is allocated
efficiently (if you're interested in this magic, have a look at
glib/gslice.[ch] in git repo).

Tadej

-- 
Tadej Borovšak
tadeboro.blogspot.com
tadeboro@xxxxxxxxx
tadej.borovsak@xxxxxxxxx
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list



[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux