Preserve progn-like clauses for coverage
[sbcl.git] / src / runtime / gc.h
blob884ba71e0de0300ec2bc7abb67b7d9e43133f091
1 /*
2 * garbage collection
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_H_
17 #define _GC_H_
19 #include "sbcl.h"
20 #include "os.h"
21 #include <stdint.h>
23 typedef intptr_t page_index_t;
24 #ifdef LISP_FEATURE_WIN32
25 #define PAGE_INDEX_FMT "Id"
26 #elif defined(LISP_FEATURE_64_BIT)
27 #define PAGE_INDEX_FMT "ld"
28 #else
29 #define PAGE_INDEX_FMT "d"
30 #endif
32 // This decl should probably be be in gencgc-internal,
33 // except it can't be: collect_garbage() receives a generation number.
34 typedef signed char generation_index_t;
36 extern void gc_init(void);
37 extern void gc_initialize_pointers(void);
38 extern void collect_garbage(generation_index_t last_gen);
40 extern void set_auto_gc_trigger(os_vm_size_t usage);
41 extern void clear_auto_gc_trigger(void);
43 extern boolean maybe_gc(os_context_t *context);
45 extern os_vm_size_t bytes_consed_between_gcs;
47 /// Maximum number of word backwards from a simple-fun
48 /// to its containing code component - corresponds to ~128MB.
49 /// The limit exists so that we can store the layout pointer
50 /// in the header of any callable object if N_WORD_BITS = 64.
51 /// This is not technically a restriction on the code size.
52 #define FUN_HEADER_NWORDS_MASK 0xFFFFFF
54 #define fun_code_header(fun) \
55 ((lispobj*)(fun) - (HeaderValue(*(lispobj*)(fun))&FUN_HEADER_NWORDS_MASK))
57 #endif /* _GC_H_ */