Further work towards use of win32 file HANDLEs
[sbcl.git] / src / runtime / gc-common.c
index d9810fa..887337e 100644 (file)
@@ -95,27 +95,8 @@ os_vm_size_t bytes_consed_between_gcs = 12*1024*1024;
 /*
  * copying objects
  */
-static
-lispobj
-gc_general_copy_object(lispobj object, long nwords, int page_type_flag)
-{
-    int tag;
-    lispobj *new;
-
-    gc_assert(is_lisp_pointer(object));
-    gc_assert(from_space_p(object));
-    gc_assert((nwords & 0x01) == 0);
 
-    /* Get tag of object. */
-    tag = lowtag_of(object);
-
-    /* Allocate space. */
-    new = gc_general_alloc(nwords*N_WORD_BYTES, page_type_flag, ALLOC_QUICK);
-
-    /* Copy the object. */
-    memcpy(new,native_pointer(object),nwords*N_WORD_BYTES);
-    return make_lispobj(new,tag);
-}
+/* gc_general_copy_object is inline from gc-internal.h */
 
 /* to copy a boxed object */
 lispobj
@@ -2662,7 +2643,7 @@ maybe_gc(os_context_t *context)
      * A kludgy alternative is to propagate the sigmask change to the
      * outer context.
      */
-#ifndef LISP_FEATURE_WIN32
+#if !(defined(LISP_FEATURE_WIN32) || defined(LISP_FEATURE_SB_SAFEPOINT))
     check_gc_signals_unblocked_or_lose(os_context_sigmask_addr(context));
     unblock_gc_signals(0, 0);
 #endif
@@ -2687,8 +2668,10 @@ maybe_gc(os_context_t *context)
         sigset_t *context_sigmask = os_context_sigmask_addr(context);
         if (!deferrables_blocked_p(context_sigmask)) {
             thread_sigmask(SIG_SETMASK, context_sigmask, 0);
+#ifndef LISP_FEATURE_SB_SAFEPOINT
             check_gc_signals_unblocked_or_lose(0);
 #endif
+#endif
             FSHOW((stderr, "/maybe_gc: calling POST_GC\n"));
             funcall0(StaticSymbolFunction(POST_GC));
 #ifndef LISP_FEATURE_WIN32
@@ -2735,9 +2718,14 @@ maybe_gc(os_context_t *context)
  * may be what the "lame" adjective in the above comment is for. In
  * this case, exact gc may lose badly. */
 void
-scrub_control_stack(void)
+scrub_control_stack()
+{
+    scrub_thread_control_stack(arch_os_get_current_thread());
+}
+
+void
+scrub_thread_control_stack(struct thread *th)
 {
-    struct thread *th = arch_os_get_current_thread();
     os_vm_address_t guard_page_address = CONTROL_STACK_GUARD_PAGE(th);
     os_vm_address_t hard_guard_page_address = CONTROL_STACK_HARD_GUARD_PAGE(th);
 #ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK