problem when mapping malloc to GC_malloc.
Thu Jun 18 15:14:00 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
abhishek desai wrote:
> My JNI code includes redefinitions to the malloc, free and realloc
> functions (shown below). These functions call GC_malloc, GC_free and
> GC_realloc respectively. This is done so that any calls to the malloc
> get allocated through the garbage collector.
I presume you are using Hans Boehm's garbage collector? If so, did you
follow the instructions on:
What platform are you developing for? If it is not Linux, you have to
make sure that GC_INIT() is being called before using any of the GC_xxx
> However this is failing
> with segfault. Any clues why this does not work ?
> I am using this code along with the libgcj library linked dynamically
> with my application.
> void *malloc(size_t size)
> return GC_malloc(size);
> void *realloc(void *ptr, size_t size)
> return GC_realloc(ptr, size);
> void free(void *ptr)
Perhaps you can give us some more context. A simple, compilable example
would be great to see where and how exactly you are using your
"He's an unconventional pirate paramedic with a mysterious suitcase
handcuffed to his arm. She's a pregnant gypsy widow from aristocratic
European stock. They fight crime!"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the Java