This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Java objects obtained by c++: are they garbage collected?
- From: Yuri <yuri at rawbw dot com>
- To: David Daney <ddaney at caviumnetworks dot com>
- Cc: java at gcc dot gnu dot org
- Date: Fri, 16 Oct 2009 12:17:38 -0700
- Subject: Re: Java objects obtained by c++: are they garbage collected?
- References: <4AD8B945.5000407@rawbw.com> <4AD8BCCD.2070109@caviumnetworks.com>
- Reply-to: yuri at rawbw dot com
David Daney wrote:
Yuri wrote:
I compiled several Java classes into a shared library and call it's
methods from C++.
Some of these methods return Java objects.
I wonder do I have to do anything special about them in order for
them to get garbage collected?
If you use the CNI facilities to start the runtime and do the calling,
everything should just work (including garbage collection).
I initialize the runtime using CNI and call methods using dlsym + call
of that symbol.
Yuri