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
This commit is contained in:
Bryce McKinlay 2004-05-28 18:53:06 +00:00 committed by Bryce McKinlay
parent 0919ed7222
commit ca60dce284
9 changed files with 83 additions and 17 deletions

View file

@ -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);