Commit e16ffa0d by Hans Boehm Committed by Hans Boehm

boehm-gc.h: Call thread local allocation functions if THREAD_LOCAL_ALLOC is defined.

	* include/boehm-gc.h: Call thread local allocation functions
	if THREAD_LOCAL_ALLOC is defined.

From-SVN: r46490
parent cdd90341
2001-10-25 Hans Boehm <Hans_Boehm@hp.com>
* include/boehm-gc.h: Call thread local allocation functions
if THREAD_LOCAL_ALLOC is defined.
2001-10-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz> 2001-10-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* java/lang/natClassLoader.cc (_Jv_RegisterClassHookDefault): Use * java/lang/natClassLoader.cc (_Jv_RegisterClassHookDefault): Use
......
...@@ -28,23 +28,39 @@ extern "C" ...@@ -28,23 +28,39 @@ extern "C"
extern "C" void * GC_gcj_malloc(size_t, void *); extern "C" void * GC_gcj_malloc(size_t, void *);
extern "C" void * GC_malloc_atomic(size_t); extern "C" void * GC_malloc_atomic(size_t);
#ifdef THREAD_LOCAL_ALLOC
extern "C" void * GC_local_gcj_malloc(size_t, void *);
extern "C" void * GC_local_malloc_atomic(size_t);
#endif
inline void * inline void *
_Jv_AllocObj (jsize size, jclass klass) _Jv_AllocObj (jsize size, jclass klass)
{ {
// This should call GC_GCJ_MALLOC, but that would involve // This should call GC_GCJ_MALLOC, but that would involve
// including gc.h. // including gc.h.
#ifdef THREAD_LOCAL_ALLOC
return GC_local_gcj_malloc (size, klass->vtable);
#else
return GC_gcj_malloc (size, klass->vtable); return GC_gcj_malloc (size, klass->vtable);
#endif
} }
inline void * inline void *
_Jv_AllocPtrFreeObj (jsize size, jclass klass) _Jv_AllocPtrFreeObj (jsize size, jclass klass)
{ {
#ifdef JV_HASH_SYNCHRONIZATION #ifdef JV_HASH_SYNCHRONIZATION
void * obj = GC_malloc_atomic(size); # ifdef THREAD_LOCAL_ALLOC
void * obj = GC_local_malloc_atomic(size);
# else
void * obj = GC_malloc_atomic(size);
# endif
*((_Jv_VTable **) obj) = klass->vtable; *((_Jv_VTable **) obj) = klass->vtable;
#else #else
void * obj = GC_gcj_malloc(size, klass->vtable); # ifdef THREAD_LOCAL_ALLOC
void * obj = GC_local_gcj_malloc(size, klass->vtable);
# else
void * obj = GC_gcj_malloc(size, klass->vtable);
# endif
#endif #endif
return obj; return obj;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment