diff options
author | Bryce McKinlay <mckinlay@redhat.com> | 2004-05-28 18:53:06 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2004-05-28 19:53:06 +0100 |
commit | ca60dce284a912a0e62500ed6b097c1960dce26e (patch) | |
tree | a45dca3a962b2788d50822d0c51a8159a48662d5 /libjava/java | |
parent | 0919ed7222874f28a047d4ace01e15efd7edfe7d (diff) | |
download | gcc-ca60dce284a912a0e62500ed6b097c1960dce26e.zip gcc-ca60dce284a912a0e62500ed6b097c1960dce26e.tar.gz gcc-ca60dce284a912a0e62500ed6b097c1960dce26e.tar.bz2 |
gcj.texi (Object allocation): Remove _Jv_AllocBytes.
* gcj.texi (Object allocation): Remove _Jv_AllocBytes.
(Mixing with C++): Document JvAllocBytes and RawDataManaged.
* gcj/cni.h (JvAllocBytes): New public CNI function. Calls
_Jv_AllocBytes.
* gnu/gcj/RawDataManaged.java: New file.
* java/lang/Thread.java (data): Declare as RawDataManaged.
* java/lang/natThread.cc (init_native): Cast natThread data to
RawDataManaged, not jobject.
* Makefile.am (ordinary_java_source_files): Add RawDataManaged.
* Makefile.in: Rebuilt.
From-SVN: r82372
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/Thread.java | 3 | ||||
-rw-r--r-- | libjava/java/lang/natThread.cc | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/libjava/java/lang/Thread.java b/libjava/java/lang/Thread.java index 0232a1d..f631cc5 100644 --- a/libjava/java/lang/Thread.java +++ b/libjava/java/lang/Thread.java @@ -39,6 +39,7 @@ exception statement from your version. */ package java.lang; import gnu.gcj.RawData; +import gnu.gcj.RawDataManaged; /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 @@ -127,7 +128,7 @@ public class Thread implements Runnable RawData interp_frame; // Our native data - points to an instance of struct natThread. - private Object data; + private RawDataManaged data; /** * Allocates a new <code>Thread</code> object. This constructor has diff --git a/libjava/java/lang/natThread.cc b/libjava/java/lang/natThread.cc index a131f05..ea235ce 100644 --- a/libjava/java/lang/natThread.cc +++ b/libjava/java/lang/natThread.cc @@ -16,6 +16,7 @@ details. */ #include <jvm.h> #include <java-threads.h> +#include <gnu/gcj/RawDataManaged.h> #include <java/lang/Thread.h> #include <java/lang/ThreadGroup.h> #include <java/lang/IllegalArgumentException.h> @@ -59,11 +60,7 @@ java::lang::Thread::initialize_native (void) { natThread *nt = (natThread *) _Jv_AllocBytes (sizeof (natThread)); - // The native thread data is kept in a Object field, not a RawData, so that - // the GC allocator can be used and a finalizer run after the thread becomes - // unreachable. Note that this relies on the GC's ability to finalize - // non-Java objects. FIXME? - data = reinterpret_cast<jobject> (nt); + data = (gnu::gcj::RawDataManaged *) nt; // Register a finalizer to clean up the native thread resources. _Jv_RegisterFinalizer (data, finalize_native); |