X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fgc-internal.h;h=c1e08346494437d48e8d3f7ee79c2cf0e0669ff5;hb=decddddf7e581fa1ebee846e5fddcd52229bb9a8;hp=c9d1911246bbe365960783b906076228e5415728;hpb=cb83aa22932bf4b9bc74ac6f0fcd91db1702ad33;p=sbcl.git diff --git a/src/runtime/gc-internal.h b/src/runtime/gc-internal.h index c9d1911..c1e0834 100644 --- a/src/runtime/gc-internal.h +++ b/src/runtime/gc-internal.h @@ -19,7 +19,11 @@ #include /* disabling gc assertions made no discernable difference to GC speed, - * last I tried it - dan 2003.12.21 */ + * last I tried it - dan 2003.12.21 + * + * And it's unsafe to do so while things like gc_assert(0 == + * thread_mutex_lock(&allocation_lock)) exist. - MG 2009-01-13 + */ #if 1 # define gc_assert(ex) \ do { \ @@ -72,12 +76,33 @@ NWORDS(unsigned long x, unsigned long n_bits) #define BOXED_PAGE_FLAG 1 #define UNBOXED_PAGE_FLAG 2 #define OPEN_REGION_PAGE_FLAG 4 +#define CODE_PAGE_FLAG (BOXED_PAGE_FLAG|UNBOXED_PAGE_FLAG) #define ALLOC_BOXED 0 #define ALLOC_UNBOXED 1 #define ALLOC_QUICK 1 -void *gc_general_alloc(long nbytes,int unboxed_p,int quick_p); +#ifdef LISP_FEATURE_GENCGC +#include "gencgc-alloc-region.h" +void * +gc_alloc_with_region(long nbytes,int page_type_flag, struct alloc_region *my_region, + int quick_p); +static inline void * +gc_general_alloc(long nbytes, int page_type_flag, int quick_p) +{ + struct alloc_region *my_region; + if (UNBOXED_PAGE_FLAG == page_type_flag) { + my_region = &unboxed_region; + } else if (BOXED_PAGE_FLAG & page_type_flag) { + my_region = &boxed_region; + } else { + lose("bad page type flag: %d", page_type_flag); + } + return gc_alloc_with_region(nbytes, page_type_flag, my_region, quick_p); +} +#else +extern void *gc_general_alloc(long nbytes,int page_type_flag,int quick_p); +#endif extern long (*scavtab[256])(lispobj *where, lispobj object); extern lispobj (*transother[256])(lispobj object); @@ -96,6 +121,7 @@ lispobj copy_large_unboxed_object(lispobj object, long nwords); lispobj copy_unboxed_object(lispobj object, long nwords); lispobj copy_large_object(lispobj object, long nwords); lispobj copy_object(lispobj object, long nwords); +lispobj copy_code_object(lispobj object, long nwords); lispobj *search_read_only_space(void *pointer); lispobj *search_static_space(void *pointer);