X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Falloc.c;h=9d9c6d68ba8b4a8a41974cd3f9db29daa17dabd1;hb=905a0fc4c21ff6c8c752b9436e0616b868f1dfcc;hp=01354b421c738d57dff263002a4501b834530bb0;hpb=3bb2fb5b9ecdeebecaded4ac6e5af0f653be8867;p=sbcl.git diff --git a/src/runtime/alloc.c b/src/runtime/alloc.c index 01354b4..9d9c6d6 100644 --- a/src/runtime/alloc.c +++ b/src/runtime/alloc.c @@ -17,18 +17,17 @@ #include #include +#include "sbcl.h" #include "runtime.h" #include "os.h" -#include "sbcl.h" #include "alloc.h" #include "globals.h" #include "gc.h" -#include "genesis/static-symbols.h" +#include "thread.h" #include "genesis/vector.h" #include "genesis/cons.h" #include "genesis/bignum.h" #include "genesis/sap.h" -#include "genesis/symbol.h" #define GET_FREE_POINTER() dynamic_space_free_pointer #define SET_FREE_POINTER(new_value) \ @@ -45,11 +44,12 @@ lispobj * pa_alloc(int bytes) { lispobj *result=0; - SetSymbolValue(PSEUDO_ATOMIC_INTERRUPTED, make_fixnum(0)); - SetSymbolValue(PSEUDO_ATOMIC_ATOMIC, make_fixnum(1)); + struct thread *th=arch_os_get_current_thread(); + SetSymbolValue(PSEUDO_ATOMIC_INTERRUPTED, make_fixnum(0),th); + SetSymbolValue(PSEUDO_ATOMIC_ATOMIC, make_fixnum(1),th); result=alloc(bytes); - SetSymbolValue(PSEUDO_ATOMIC_ATOMIC, make_fixnum(0)); - if (SymbolValue(PSEUDO_ATOMIC_INTERRUPTED)) + SetSymbolValue(PSEUDO_ATOMIC_ATOMIC, make_fixnum(0),th); + if (SymbolValue(PSEUDO_ATOMIC_INTERRUPTED,th)) /* even if we gc at this point, the new allocation will be * protected from being moved, because result is on the c stack * and points to it */ @@ -131,10 +131,10 @@ alloc_number(long n) } lispobj -alloc_string(char *str) +alloc_base_string(char *str) { int len = strlen(str); - lispobj result = alloc_vector(SIMPLE_STRING_WIDETAG, len+1, 8); + lispobj result = alloc_vector(SIMPLE_BASE_STRING_WIDETAG, len+1, 8); struct vector *vec = (struct vector *)native_pointer(result); vec->length = make_fixnum(len);