If you're using GSlice on a dynamically-sized array, you are using GSlice wrong. This is not what GSlice was designed for and you will cause fragmentation.
The case for munmap is better, but again, I'd just store the overall size of the region, rather than calculating it again.
The case for munmap is better, but again, I'd just store the overall size of the region, rather than calculating it again.
On Tue, Dec 18, 2012 at 5:57 PM, David Nečas <yeti@xxxxxxxxxxxxxxx> wrote:
On Tue, Dec 18, 2012 at 05:37:08PM -0500, Jasper St. Pierre wrote:And the call for freeing a GSlice-allocated block of memory is
> The call for freeing a block of memory is free(void *data);
void g_slice_free1(gsize block_size, gpointer mem_block);
And the call for freeing a memory-mapped region is
int munmap(void *addr, size_t length);
I missed the start of the thread and can't comment on that, but freeing
memory may require all kinds of knowledge.
Yeti
--
Jasper
_______________________________________________ gtk-list mailing list gtk-list@xxxxxxxxx https://mail.gnome.org/mailman/listinfo/gtk-list