From 3d47c8d21b6688383ea4c0728805bddfefefb266 Mon Sep 17 00:00:00 2001 From: Salikh Zakirov Date: Thu, 15 Mar 2007 20:00:24 +0300 Subject: [PATCH] Remove thread local pool --- vm/thread/src/hythr.def | 1 - vm/thread/src/hythr.exp | 1 - vm/thread/src/thread_native_basic.c | 13 ------------- vm/thread/src/thread_native_latch.c | 2 -- vm/thread/src/thread_private.h | 24 ------------------------ 5 files changed, 0 insertions(+), 41 deletions(-) diff --git a/vm/thread/src/hythr.def b/vm/thread/src/hythr.def index f4387fa..0953cc5 100644 --- a/vm/thread/src/hythr.def +++ b/vm/thread/src/hythr.def @@ -146,7 +146,6 @@ array_add array_create array_delete array_get -get_local_pool get_java_thread_group Java_org_apache_harmony_drlvm_thread_ThreadHelper_getThreadIdOffset diff --git a/vm/thread/src/hythr.exp b/vm/thread/src/hythr.exp index aaf8a32..226c2fd 100644 --- a/vm/thread/src/hythr.exp +++ b/vm/thread/src/hythr.exp @@ -157,7 +157,6 @@ array_add; array_create; array_delete; array_get; -get_local_pool; get_java_thread_group; Java_org_apache_harmony_drlvm_thread_ThreadHelper_getThreadIdOffset; diff --git a/vm/thread/src/thread_native_basic.c b/vm/thread/src/thread_native_basic.c index 37df2ad..b3c54f3 100644 --- a/vm/thread/src/thread_native_basic.c +++ b/vm/thread/src/thread_native_basic.c @@ -723,16 +723,3 @@ extern HY_CFUNC void VMCALL // unreachable statement abort(); } - -apr_pool_t* get_local_pool() { - hythread_t self = tm_self_tls; - return self == NULL ? TM_POOL : self->pool; -} - -/** - * TODO: implement this function to reduce memory leaks. - */ -IDATA local_pool_cleanup_register(void* func, void* data) { - return TM_ERROR_NONE; -} - diff --git a/vm/thread/src/thread_native_latch.c b/vm/thread/src/thread_native_latch.c index bc9008d..fdcfeab 100644 --- a/vm/thread/src/thread_native_latch.c +++ b/vm/thread/src/thread_native_latch.c @@ -43,8 +43,6 @@ IDATA VMCALL hylatch_create(hylatch_t *latch, IDATA count) { int r; hylatch_t l; - apr_pool_t *pool = get_local_pool(); - apr_status_t apr_status; l = malloc(sizeof(HyLatch)); if (l == NULL) { diff --git a/vm/thread/src/thread_private.h b/vm/thread/src/thread_private.h index 2af5e58..096a81e 100644 --- a/vm/thread/src/thread_private.h +++ b/vm/thread/src/thread_private.h @@ -105,30 +105,6 @@ __forceinline hythread_t tmn_self_macro() { #define tm_self_tls (hythread_self()) #endif -/** - * get_local_pool() function return apr pool associated with the current thread. - * the memory could be allocated without lock using this pool - * deallocation should be done in the same thread, otherwise - * local_pool_cleanup_register() should be called - */ -apr_pool_t* get_local_pool(); - -/** - * local_pool_cleanup_register() synchronously register the cleanup function. - * It should be called to request cleanup in thread local pool, from other thread - * Usage scenario: - * IDATA hymutex_destroy (tm_mutex_t *mutex) { - * apr_pool_t *pool = apr_thread_mutex_pool_get ((apr_thread_mutex_t*)mutex); - * if (pool != get_local_pool()) { - * return local_pool_cleanup_register(hymutex_destroy, mutex); - * } - * apr_thread_mutex_destroy(mutex); - * return TM_ERROR_NONE; - * } - * - */ -IDATA local_pool_cleanup_register(void* func, void* data); - #ifdef __linux__ #define osthread_t pthread_t -- 1.5.0.33.g1b20