2 * garbage collection - shared definitions for modules "inside" the GC system
6 * This software is part of the SBCL system. See the README file for
9 * This software is derived from the CMU CL system, which was
10 * written at Carnegie Mellon University and released into the
11 * public domain. The software is in the public domain and is
12 * provided with absolutely no warranty. See the COPYING and CREDITS
13 * files for more information.
16 #ifndef _GC_INTERNAL_H_
17 #define _GC_INTERNAL_H_
19 /* disabling gc assertions made no discernable difference to GC speed,
20 * last I tried it - dan 2003.12.21 */
22 #define gc_assert(ex) do { \
23 if (!(ex)) gc_abort(); \
28 #define gc_abort() lose("GC invariant lost, file \"%s\", line %d", \
31 #define CEILING(x,y) (((x) + ((y) - 1)) & (~((y) - 1)))
32 #define NWORDS(x,y) (CEILING((x),(y)) / (y))
34 /* FIXME: Shouldn't this be defined in sbcl.h? */
35 #define FUN_RAW_ADDR_OFFSET (6*sizeof(lispobj) - FUN_POINTER_LOWTAG)
37 /* values for the *_alloc_* parameters */
38 #define FREE_PAGE_FLAG 0
39 #define BOXED_PAGE_FLAG 1
40 #define UNBOXED_PAGE_FLAG 2
41 #define OPEN_REGION_PAGE_FLAG 4
44 #define ALLOC_UNBOXED 1
47 void *gc_general_alloc(int nbytes,int unboxed_p,int quick_p);
49 extern int (*scavtab[256])(lispobj *where, lispobj object);
50 extern lispobj (*transother[256])(lispobj object);
51 extern int (*sizetab[256])(lispobj *where);
53 extern struct weak_pointer *weak_pointers; /* in gc-common.c */
55 extern void scavenge(lispobj *start, long n_words);
56 extern void scan_weak_pointers(void);
58 lispobj copy_large_unboxed_object(lispobj object, int nwords);
59 lispobj copy_unboxed_object(lispobj object, int nwords);
60 lispobj copy_large_object(lispobj object, int nwords);
61 lispobj copy_object(lispobj object, int nwords);
63 #ifdef LISP_FEATURE_GENCGC
64 #include "gencgc-internal.h"
66 #include "cheneygc-internal.h"
69 #endif /* _GC_INTERNAL_H_ */