This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Illegal Package-Private Accesses in 3.4


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/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]