summaryrefslogtreecommitdiff
path: root/darwin_stop_world.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2016-08-19 01:43:25 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-08-19 01:43:25 +0300
commita69a6aea819a1bae03bb7535419fc28aabb252b4 (patch)
tree7df68d11c9050de6a1531c56f11ca054131e2f3d /darwin_stop_world.c
parent37c32b9b1e10b4c1a97dee05614d930e39010c43 (diff)
downloadbdwgc-a69a6aea819a1bae03bb7535419fc28aabb252b4.tar.gz
Eliminate 'cast to void* from int' compiler warnings (Darwin/x64)
* darwin_stop_world.c (GC_stack_range_for, GC_suspend_thread_list, GC_stop_world, GC_thread_resume, GC_start_world): Cast thread variable to pointer via word type. * darwin_stop_world.c (GC_stop_world): Cast stop_info.mach_thread to pointer via word type.
Diffstat (limited to 'darwin_stop_world.c')
-rw-r--r--darwin_stop_world.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/darwin_stop_world.c b/darwin_stop_world.c
index 21e7e1ce..e3c05480 100644
--- a/darwin_stop_world.c
+++ b/darwin_stop_world.c
@@ -314,7 +314,7 @@ STATIC ptr_t GC_stack_range_for(ptr_t *phi, thread_act_t thread, GC_thread p,
}
# ifdef DEBUG_THREADS
GC_log_printf("Darwin: Stack for thread %p = [%p,%p)\n",
- (void *)thread, lo, *phi);
+ (void *)(word)thread, lo, *phi);
# endif
return lo;
}
@@ -452,7 +452,8 @@ STATIC GC_bool GC_suspend_thread_list(thread_act_array_t act_list, int count,
# endif
# ifdef DEBUG_THREADS
- GC_log_printf("Attempting to suspend thread %p\n", (void *)thread);
+ GC_log_printf("Attempting to suspend thread %p\n",
+ (void *)(word)thread);
# endif
/* find the current thread in the old list */
found = FALSE;
@@ -496,7 +497,8 @@ STATIC GC_bool GC_suspend_thread_list(thread_act_array_t act_list, int count,
continue;
}
# ifdef DEBUG_THREADS
- GC_log_printf("Thread state for %p = %d\n", (void *)thread, info.run_state);
+ GC_log_printf("Thread state for %p = %d\n", (void *)(word)thread,
+ info.run_state);
# endif
if (info.suspend_count != 0) {
/* thread is already suspended. */
@@ -506,7 +508,7 @@ STATIC GC_bool GC_suspend_thread_list(thread_act_array_t act_list, int count,
}
# ifdef DEBUG_THREADS
- GC_log_printf("Suspending %p\n", (void *)thread);
+ GC_log_printf("Suspending %p\n", (void *)(word)thread);
# endif
kern_result = thread_suspend(thread);
if (kern_result != KERN_SUCCESS) {
@@ -519,7 +521,7 @@ STATIC GC_bool GC_suspend_thread_list(thread_act_array_t act_list, int count,
if (!found)
GC_mach_threads_count++;
if (GC_on_thread_event)
- GC_on_thread_event(GC_EVENT_THREAD_SUSPENDED, (void *)thread);
+ GC_on_thread_event(GC_EVENT_THREAD_SUSPENDED, (void *)(word)thread);
}
return changed;
}
@@ -535,7 +537,8 @@ GC_INNER void GC_stop_world(void)
kern_return_t kern_result;
# ifdef DEBUG_THREADS
- GC_log_printf("Stopping the world from thread %p\n", (void *)my_thread);
+ GC_log_printf("Stopping the world from thread %p\n",
+ (void *)(word)my_thread);
# endif
# ifdef PARALLEL_MARK
if (GC_parallel) {
@@ -610,7 +613,7 @@ GC_INNER void GC_stop_world(void)
ABORT("thread_suspend failed");
if (GC_on_thread_event)
GC_on_thread_event(GC_EVENT_THREAD_SUSPENDED,
- (void *)p->stop_info.mach_thread);
+ (void *)(word)p->stop_info.mach_thread);
}
}
}
@@ -627,7 +630,7 @@ GC_INNER void GC_stop_world(void)
# endif
# ifdef DEBUG_THREADS
- GC_log_printf("World stopped from %p\n", (void *)my_thread);
+ GC_log_printf("World stopped from %p\n", (void *)(word)my_thread);
# endif
mach_port_deallocate(my_task, my_thread);
}
@@ -644,7 +647,7 @@ GC_INLINE void GC_thread_resume(thread_act_t thread)
ABORT("thread_info failed");
# endif
# ifdef DEBUG_THREADS
- GC_log_printf("Resuming thread %p with state %d\n", (void *)thread,
+ GC_log_printf("Resuming thread %p with state %d\n", (void *)(word)thread,
info.run_state);
# endif
/* Resume the thread */
@@ -652,7 +655,7 @@ GC_INLINE void GC_thread_resume(thread_act_t thread)
if (kern_result != KERN_SUCCESS)
ABORT("thread_resume failed");
if (GC_on_thread_event)
- GC_on_thread_event(GC_EVENT_THREAD_UNSUSPENDED, (void *)thread);
+ GC_on_thread_event(GC_EVENT_THREAD_UNSUSPENDED, (void *)(word)thread);
}
/* Caller holds allocation lock, and has held it continuously since */
@@ -705,7 +708,7 @@ GC_INNER void GC_start_world(void)
if (GC_mach_threads[j].already_suspended) {
# ifdef DEBUG_THREADS
GC_log_printf("Not resuming already suspended thread %p\n",
- (void *)thread);
+ (void *)(word)thread);
# endif
} else {
GC_thread_resume(thread);