Re: g_object_new shared memory



On Mon, Oct 26, 2009 at 05:09:42PM +0700, Hieu Le Trung wrote:
I'm using GLib in my application, and I'm using g_object_new to allocate
memory of an object. As in C++ specification, there is "new" placement
technique that can allow us to place a new object into our predefined
memory region. And we can also do with malloc by redefine the malloc
fuction.

I wonder if we can do it with g_object_new or not? The purpose is to
have g_object_new to allocate memory on my own memory region.

I don't think it's possible because g_type_create_instance() has the
allocation function hardcoded (g_slice_alloc0() at this moment).

Yeti




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