/* pointer to the top of the corresponding memory stack. */
ptr_t GC_save_regs_in_stack(void);
#endif
- /* Push register contents onto mark stack. */
-#if defined(MSWIN32) || defined(MSWINCE)
- void __cdecl GC_push_one(word p);
-#else
+ /* Push register contents onto mark stack. */
+#if defined(AMIGA) || defined(MACOS) || defined(GC_DARWIN_THREADS)
void GC_push_one(word p);
/* If p points to an object, mark it */
/* and push contents on the mark stack */
/* stack. */
#endif
+#ifdef GC_WIN32_THREADS
+ /* Same as GC_push_one but for a sequence of registers. */
+ GC_INNER void GC_push_many_regs(const word *regs, unsigned count);
+#endif
+
#if defined(PRINT_BLACK_LIST) || defined(KEEP_BACK_PTRS)
GC_INNER void GC_mark_and_push_stack(ptr_t p, ptr_t source);
/* Ditto, omits plausibility test */
}
#endif /* GC_DISABLE_INCREMENTAL */
-#if defined(MSWIN32) || defined(MSWINCE)
- void __cdecl GC_push_one(word p)
-#else
+#if defined(AMIGA) || defined(MACOS) || defined(GC_DARWIN_THREADS)
void GC_push_one(word p)
-#endif
-{
+ {
GC_PUSH_ONE_STACK(p, MARKED_FROM_REGISTER);
-}
+ }
+#endif
+
+#ifdef GC_WIN32_THREADS
+ GC_INNER void GC_push_many_regs(const word *regs, unsigned count)
+ {
+ unsigned i;
+ for (i = 0; i < count; i++)
+ GC_PUSH_ONE_STACK(regs[i], MARKED_FROM_REGISTER);
+ }
+#endif
GC_API struct GC_ms_entry * GC_CALL GC_mark_and_push(void *obj,
mse *mark_stack_ptr,
sp = GC_approx_sp();
} else if ((sp = thread -> thread_blocked_sp) == NULL) {
/* Use saved sp value for blocked threads. */
- int i = 0;
# ifdef RETRY_GET_THREAD_CONTEXT
/* We cache context when suspending the thread since it may */
/* require looping. */
}
# endif
-# ifdef WOW64_THREAD_CONTEXT_WORKAROUND
- i += 2; /* skip ContextFlags and SegFs */
-# endif
- for (; i < PUSHED_REGS_COUNT; i++)
- GC_push_one(regs[i]);
+# ifndef WOW64_THREAD_CONTEXT_WORKAROUND
+ GC_push_many_regs(regs, PUSHED_REGS_COUNT);
+# else
+ GC_push_many_regs(regs + 2, PUSHED_REGS_COUNT - 2);
+ /* skip ContextFlags and SegFs */
-# ifdef WOW64_THREAD_CONTEXT_WORKAROUND
/* WoW64 workaround. */
if (isWow64) {
DWORD ContextFlags = (DWORD)regs[0];