RE: g_object_new shared memory



On Monday, October 26, 2009 5:22 PM, David NeÄas wrote:
On Mon, Oct 26, 2009 at 05:09:42PM +0700, Hieu Le Trung wrote:
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).

Can I change the g_slide_alloc0 to use my own alloc function so that it can be allocated in a shared region?
Or can I override the constructor of my class so that the private data is allocated in a shared region, then 
in other application, I'll reconstruct the object using g_object_new and then set the private data pointer 
manually?

Regards,
-Hieu


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