alloca and native code

Andrew Haley aph@redhat.com
Tue Sep 12 07:14:00 GMT 2000


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.



More information about the Java mailing list