0.7.13.5
[sbcl/lichteblau.git] / src / runtime / gc-internal.h
blobd0f99bf1e05f97078a922fc2389b37e1ac36fcaa
1 /*
2 * garbage collection - shared definitions for modules "inside" the GC system
3 */
5 /*
6 * This software is part of the SBCL system. See the README file for
7 * more information.
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 #if 1
20 #define gc_assert(ex) do { \
21 if (!(ex)) gc_abort(); \
22 } while (0)
23 #else
24 #define gc_assert(ex)
25 #endif
26 #define gc_abort() lose("GC invariant lost, file \"%s\", line %d", \
27 __FILE__, __LINE__)
29 #define CEILING(x,y) (((x) + ((y) - 1)) & (~((y) - 1)))
30 #define NWORDS(x,y) (CEILING((x),(y)) / (y))
32 /* FIXME: Shouldn't this be defined in sbcl.h? */
33 #define FUN_RAW_ADDR_OFFSET (6*sizeof(lispobj) - FUN_POINTER_LOWTAG)
35 /* values for the *_alloc_* parameters */
36 #define FREE_PAGE 0
37 #define BOXED_PAGE 1
38 #define UNBOXED_PAGE 2
39 #define OPEN_REGION_PAGE 4
41 #define ALLOC_BOXED 0
42 #define ALLOC_UNBOXED 1
43 #define ALLOC_QUICK 1
45 void *gc_general_alloc(int nbytes,int unboxed_p,int quick_p);
47 extern int (*scavtab[256])(lispobj *where, lispobj object);
48 extern lispobj (*transother[256])(lispobj object);
49 extern int (*sizetab[256])(lispobj *where);
51 extern struct weak_pointer *weak_pointers; /* in gc-common.c */
53 extern void scavenge(lispobj *start, long n_words);
54 extern void scan_weak_pointers(void);
56 lispobj copy_large_unboxed_object(lispobj object, int nwords);
57 lispobj copy_unboxed_object(lispobj object, int nwords);
58 lispobj copy_large_object(lispobj object, int nwords);
59 lispobj copy_object(lispobj object, int nwords);
61 #ifdef LISP_FEATURE_GENCGC
62 #include "gencgc-internal.h"
63 #else
64 #include "cheneygc-internal.h"
65 #endif
67 #endif /* _GC_INTERNAL_H_ */