From: Bryce McKinlay <bmckinlay@gmail.com>
To: Craig Vanderborgh <craigvanderborgh@gmail.com>
Cc: java@gcc.gnu.org
Subject: Re: gnu.gcj.RawData vs. long
Date: Mon, 18 Jul 2011 16:18:00 -0000 [thread overview]
Message-ID: <CALUNu-rVDwBG-GdwM_xfYu=n-uoT4gdK9RWau4PV5uhjss1JJw@mail.gmail.com> (raw)
In-Reply-To: <CAG6o7Q8jwb1_UuGMorjPUinOnwObX9mPFL0MfJ=taLHEFkRiQg@mail.gmail.com>
On Mon, Jul 18, 2011 at 5:08 PM, Craig Vanderborgh
<craigvanderborgh@gmail.com> wrote:
> The problem is that gnu.gcj.RawData * is not portable. The question
> is: can I use "long" for the type instead without garbage collection
> problems? Can my native code store the pointer value in a Java "long"
> in the CNI with impunity, or will Boehm GC think these pointers needs
> to be considered for collection?
Hi Craig.
You must use gnu.gcj.RawData* if the reference being stored points to
something allocated by the GC. The GC will not mark references held in
non-pointer types.
If it's something that was allocated outside the GC (ie, with malloc),
it should be fine to use a long.
Bryce
prev parent reply other threads:[~2011-07-18 16:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-18 16:08 Craig Vanderborgh
2011-07-18 16:18 ` Bryce McKinlay [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALUNu-rVDwBG-GdwM_xfYu=n-uoT4gdK9RWau4PV5uhjss1JJw@mail.gmail.com' \
--to=bmckinlay@gmail.com \
--cc=craigvanderborgh@gmail.com \
--cc=java@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).