X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fgc-internal.h;h=1a72b88f220dacf05ca97f275adb49a5240d48b5;hb=eac461c1f1ca91cfe282c779291d582ed6b336cb;hp=d45764d85501913f011d545dc89d3fe20af9a486;hpb=568725aaf7d2d3dae486cd85210eb514c856fdb7;p=sbcl.git diff --git a/src/runtime/gc-internal.h b/src/runtime/gc-internal.h index d45764d..1a72b88 100644 --- a/src/runtime/gc-internal.h +++ b/src/runtime/gc-internal.h @@ -18,6 +18,13 @@ #include #include "thread.h" +#include "interr.h" + +#ifdef LISP_FEATURE_GENCGC +#include "gencgc-internal.h" +#else +#include "cheneygc-internal.h" +#endif /* disabling gc assertions made no discernable difference to GC speed, * last I tried it - dan 2003.12.21 @@ -105,6 +112,24 @@ gc_general_alloc(long nbytes, int page_type_flag, int quick_p) extern void *gc_general_alloc(long nbytes,int page_type_flag,int quick_p); #endif +static inline lispobj +gc_general_copy_object(lispobj object, long nwords, int page_type_flag) +{ + lispobj *new; + + gc_assert(is_lisp_pointer(object)); + gc_assert(from_space_p(object)); + gc_assert((nwords & 0x01) == 0); + + /* 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, lowtag_of(object)); +} + extern long (*scavtab[256])(lispobj *where, lispobj object); extern lispobj (*transother[256])(lispobj object); extern long (*sizetab[256])(lispobj *where); @@ -130,6 +155,9 @@ lispobj *search_dynamic_space(void *pointer); lispobj *gc_search_space(lispobj *start, size_t words, lispobj *pointer); +extern int looks_like_valid_lisp_pointer_p(lispobj pointer, lispobj *start_addr); + +extern void scavenge_control_stack(struct thread *th); extern void scrub_control_stack(); #include "fixnump.h"