Wireshark mailing list archives
Re: g_mem-chunk_destroy does not free memory for GLib > 2.8
From: Bill Meier <wmeier () newsguy com>
Date: Sat, 10 Oct 2009 10:18:58 -0400
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 <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Re: g_mem-chunk_destroy does not free memory for GLib > 2.8 Bill Meier (Oct 09)
- Re: g_mem-chunk_destroy does not free memory for GLib > 2.8 Bill Meier (Oct 10)
- Re: g_mem-chunk_destroy does not free memory for GLib > 2.8 Kovarththanan Rajaratnam (Oct 11)
- Re: g_mem-chunk_destroy does not free memory for GLib > 2.8 Kovarththanan Rajaratnam (Oct 11)
- Re: g_mem-chunk_destroy does not free memory for GLib > 2.8 Bill Meier (Oct 11)
- Re: g_mem-chunk_destroy does not free memory for GLib > 2.8 Anders Broman (Oct 12)
- Re: g_mem-chunk_destroy does not free memory for GLib > 2.8 Bill Meier (Oct 12)
- Re: g_mem-chunk_destroy does not free memory for GLib > 2.8 Bill Meier (Oct 15)
- Re: g_mem-chunk_destroy does not free memory for GLib > 2.8 Jeff Morriss (Oct 15)
- Re: g_mem-chunk_destroy does not free memory for GLib > 2.8 Bill Meier (Oct 15)
- Re: g_mem-chunk_destroy does not free memory for GLib > 2.8 Jeff Morriss (Oct 20)
- Re: g_mem-chunk_destroy does not free memory for GLib > 2.8 Bill Meier (Oct 20)
- Re: g_mem-chunk_destroy does not free memory for GLib > 2.8 Bill Meier (Oct 11)