This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Illegal Package-Private Accesses in 3.4
- From: Per Bothner <per at bothner dot com>
- To: Bryce McKinlay <bryce at mckinlay dot net dot nz>
- Cc: java-patches at gcc dot gnu dot org
- Date: Mon, 11 Aug 2003 17:04:07 -0700
- Subject: Re: Illegal Package-Private Accesses in 3.4
- References: <62D792EA-CC53-11D7-8F3E-003065F97F7C@mckinlay.net.nz>
Bryce McKinlay wrote:
In this case it probably is. But there are other places where a "GC-able
RawData" is needed - eg java.lang.Thread:
// Our native data - points to an instance of struct natThread.
private Object data;
In this situation using a JArray<jbyte> seems a reasonable option.
There are some alignment complications, but maybe we can
encapsulate them in some standard macros:
/* Number of bytes past the start of a jbyteArray to
get maximum alignment. */
#define JBYTE_INIT_PAD ...
data =
JvNewByteArray(JBYTE_INIT_PAD + sizeof(struct natThread));
#define AS_NAT_THREAD(BYTE_ARR) \
(struct natThread*) (elements(BYTE_ARR)+JBYTE_INIT_PAD)
--
--Per Bothner
per@bothner.com http://per.bothner.com/