Re: g_object_new shared memory



On Tue, 27 Oct 2009, Hieu Le Trung wrote:

Hi,

I've posted this through gtk-app-devel list but no good response. So
that I'm doing cross post here.

Please don't, this list is for discussing development of
the glib and gtk+ libraries, not applications using it.

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.

No, this is not possible. GObjects are allocated through
g_slice which uses posix_memalign and falls back on g_malloc
for very big chunks (greater than 1kb). See glib/glib/gmem.h
for an API related to malloc hooks.

Thanks,
-Hieu

Yours sincerely,
Tim Janik

---
http://lanedo.com/~timj/


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