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/lang/natThread.cc | |
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/lang/natThread.cc')
-rw-r--r-- | libjava/java/lang/natThread.cc | 7 |
1 files changed, 2 insertions, 5 deletions
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); |