public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* problem when mapping malloc to GC_malloc.
@ 2009-06-18 15:00 abhishek desai
  2009-06-18 15:14 ` Christian Nolte
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: abhishek desai @ 2009-06-18 15:00 UTC (permalink / raw)
  To: java

Hi,

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. 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)
{
        GC_free(ptr);
}


regards
abhishek

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-06-18 19:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-18 15:00 problem when mapping malloc to GC_malloc abhishek desai
2009-06-18 15:14 ` Christian Nolte
2009-06-18 16:30 ` Hans Boehm
2009-06-18 18:18   ` abhishek desai
2009-06-18 19:01     ` BGB
2009-06-18 18:07 ` BGB

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).