summaryrefslogtreecommitdiff
path: root/pthread_support.c
diff options
context:
space:
mode:
authorivmai <ivmai>2010-10-05 09:07:06 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:55 +0200
commit34867e9d2269c71f9753f7ce472904f9c4528a28 (patch)
treecbbe4beac7d1083cfcddf204324f43eeae6020cf /pthread_support.c
parent0563224f6bb7401823f126f82aeb6ef95765d4b3 (diff)
2010-10-05 Ivan Maidanski <ivmai@mail.ru>
* finalize.c (GC_check_finalizer_nested): Change return type to char pointer (instead of int pointer); use explicit cast for GC_finalizer_nested assignment. * pthread_support.c (GC_check_finalizer_nested): Ditto. * win32_threads.c (GC_check_finalizer_nested): Ditto. * finalize.c (GC_finalizer_nested): Change type to unsigned char. * finalize.c (GC_notify_or_invoke_finalizers): Change type of "pnested" local variable to char pointer. * pthread_support.c (GC_do_blocking_inner, GC_call_with_gc_active): Use explicit cast for "thread_blocked" field assignment. * win32_threads.c (GC_lookup_pthread): Use explicit cast for "suspended" field assignment. * win32_threads.c (GC_Thread_Rep): Use short type for finalizer_skipped; use char type for finalizer_nested and flags fields and reorder some fields (to minimize GC_Thread_Rep structure size). * include/private/pthread_support.h (GC_Thread_Rep): Ditto. * win32_threads.c (GC_Thread_Rep): Use char type for suspended field (instead of GC_bool). * include/private/pthread_support.h (GC_Thread_Rep): Use char type for thread_blocked field (instead of short).
Diffstat (limited to 'pthread_support.c')
-rw-r--r--pthread_support.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pthread_support.c b/pthread_support.c
index 7610ce2..6c20209 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -547,7 +547,7 @@ GC_INNER void GC_reset_finalizer_nested(void)
/* collector (to minimize the risk of a deep finalizers recursion), */
/* otherwise returns a pointer to the thread-local finalizer_nested. */
/* Called by GC_notify_or_invoke_finalizers() only (the lock is held). */
-GC_INNER unsigned *GC_check_finalizer_nested(void)
+GC_INNER unsigned char *GC_check_finalizer_nested(void)
{
GC_thread me = GC_lookup_thread(pthread_self());
unsigned nesting_level = me->finalizer_nested;
@@ -558,7 +558,7 @@ GC_INNER unsigned *GC_check_finalizer_nested(void)
if (++me->finalizer_skipped < (1U << nesting_level)) return NULL;
me->finalizer_skipped = 0;
}
- me->finalizer_nested = nesting_level + 1;
+ me->finalizer_nested = (unsigned char)(nesting_level + 1);
return &me->finalizer_nested;
}
@@ -1019,7 +1019,7 @@ GC_INNER void GC_do_blocking_inner(ptr_t data, void * context)
# ifdef IA64
me -> backing_store_ptr = GC_save_regs_in_stack();
# endif
- me -> thread_blocked = TRUE;
+ me -> thread_blocked = (unsigned char)TRUE;
/* Save context here if we want to support precise stack marking */
UNLOCK();
d -> client_data = (d -> fn)(d -> client_data);
@@ -1054,7 +1054,7 @@ GC_API void * GC_CALL GC_call_with_gc_active(GC_fn_type fn,
GC_stackbottom = (ptr_t)(&stacksect);
}
- if (me -> thread_blocked == FALSE) {
+ if (!me->thread_blocked) {
/* We are not inside GC_do_blocking() - do nothing more. */
UNLOCK();
return fn(client_data);
@@ -1084,7 +1084,7 @@ GC_API void * GC_CALL GC_call_with_gc_active(GC_fn_type fn,
# ifdef IA64
me -> backing_store_ptr = stacksect.saved_backing_store_ptr;
# endif
- me -> thread_blocked = TRUE;
+ me -> thread_blocked = (unsigned char)TRUE;
me -> stop_info.stack_ptr = stacksect.saved_stack_ptr;
UNLOCK();