Re: GObject Destruction



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.


On Tue, Dec 18, 2012 at 5:57 PM, David Nečas <yeti physics muni cz> wrote:
On Tue, Dec 18, 2012 at 05:37:08PM -0500, Jasper St. Pierre wrote:
> The call for freeing a block of memory is free(void *data);

And the call for freeing a GSlice-allocated block of memory is

    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



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