De-flake 'traceroot' test
[sbcl.git] / src / runtime / gc.h
blob2437432f0f04e973f9b4be4fe69c542f852d576b
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;
25 // This decl should probably be be in gencgc-internal,
26 // except it can't be: collect_garbage() receives a generation number.
27 typedef signed char generation_index_t;
29 extern void gc_init(void);
30 extern void gc_initialize_pointers(void);
31 extern void collect_garbage(generation_index_t last_gen);
33 extern void set_auto_gc_trigger(os_vm_size_t usage);
34 extern void clear_auto_gc_trigger(void);
36 extern boolean maybe_gc(os_context_t *context);
38 extern os_vm_size_t bytes_consed_between_gcs;
40 /// Maximum number of word backwards from a simple-fun
41 /// to its containing code component - corresponds to ~128MB.
42 /// The limit exists so that we can store the layout pointer
43 /// in the header of any callable object if N_WORD_BITS = 64.
44 /// This is not technically a restriction on the code size.
45 #define FUN_HEADER_NWORDS_MASK 0xFFFFFF
47 #define fun_code_header(fun) \
48 ((lispobj*)(fun) - (HeaderValue(*(lispobj*)(fun))&FUN_HEADER_NWORDS_MASK))
50 #endif /* _GC_H_ */