X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fgencgc.c;h=5829b5a6594d96238cff2b941e3134f9bd0cf58d;hb=43c6634142a96e1d1bab2efe1a39cd8234903c41;hp=f4cbcc76ea700cf14af4d0570a68237f19b47b74;hpb=1b6d885eaf7872b41947e0ea0da134cceee4cc0f;p=sbcl.git diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index f4cbcc7..5829b5a 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -597,7 +597,7 @@ report_heap_exhaustion(long available, long requested, struct thread *th) } -#if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64) +#if defined(LISP_FEATURE_X86) void fast_bzero(void*, size_t); /* in -assem.S */ #endif @@ -4303,13 +4303,28 @@ general_alloc(sword_t nbytes, int page_type_flag) } } -lispobj * +lispobj AMD64_SYSV_ABI * alloc(long nbytes) { -#if !(defined(LISP_FEATURE_WIN32) && defined(LISP_FEATURE_SB_THREAD)) +#ifdef LISP_FEATURE_WIN32 + /* WIN32 is currently the only platform where inline allocation is + * not pseudo atomic. */ + struct thread *self = arch_os_get_current_thread(); + int was_pseudo_atomic = get_pseudo_atomic_atomic(self); + if (!was_pseudo_atomic) + set_pseudo_atomic_atomic(self); +#else gc_assert(get_pseudo_atomic_atomic(arch_os_get_current_thread())); #endif - return general_alloc(nbytes, BOXED_PAGE_FLAG); + + lispobj *result = general_alloc(nbytes, BOXED_PAGE_FLAG); + +#ifdef LISP_FEATURE_WIN32 + if (!was_pseudo_atomic) + clear_pseudo_atomic_atomic(self); +#endif + + return result; } /*