Bill Meier wrote: <snip> > > If there is no simple way to free up what may be an array of many > multiple slices, I'm inclined to replace the use of GMemChunk (at least > for those cases) by the use of GArray. > > After a quick look, one concern I have is about constantly extending a > GArray thus causing a copy each time. I note that it does seem that > space for multiple entries can be pre-allocated. So: a wrapper for > GArray could be coded which more or less does what I GMemChunk used to > do. Or: does GArray have some builtin optimization ?
Looking at the GLib source for GArray I see that there is built-in optimization with respect to allocating space when an item is added to an array. So: memory allocation appears to not be an issue when using GArrays. ___________________________________________________________________________ Sent via: Wireshark-dev mailing list <[email protected]> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:[email protected]?subject=unsubscribe
