This is the mail archive of the
java-discuss@sources.redhat.com
mailing list for the Java project.
Re: alloca and native code
- To: Jeff Sturm <jeff dot sturm at appnet dot com>
- Subject: Re: alloca and native code
- From: Andrew Haley <aph at redhat dot com>
- Date: Tue, 12 Sep 2000 15:13:18 +0100 (BST)
- Cc: Oskar Liljeblad <osk at hem dot passagen dot se>, java-discuss at sourceware dot cygnus dot com
- References: <20000912123132.A27966@strix.eductussyd.se><39BE3843.AC08B472@appnet.com>
Jeff Sturm writes:
>
> > I want to allocate a piece
> > of memory which isn't scanned or collected by the GC, which is freed
> > when the (native implementation of the) method returns.
>
> Memory reserved with alloca() _will_ be scanned by boehm-gc, like the rest of
> the stack. To avoid that, you could allocate memory with _Jv_AllocBytes
> instead.
Yeah. We use alloca() in a couple of places that we should purge. I
have done this myself. :-(
Andrew.