aaron-thesisarm-ehcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change
on this file since d67a9a1 was
d67a9a1,
checked in by Thierry Delisle <tdelisle@…>, 7 years ago
|
pool alloc functional
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[e47f529] | 1 | #pragma once |
---|
| 2 | |
---|
| 3 | #include <stddef.h> |
---|
| 4 | #include <stdint.h> |
---|
| 5 | |
---|
| 6 | #include "tools.h" |
---|
| 7 | |
---|
| 8 | #include "gcpointers.h" |
---|
| 9 | #include "internal/collector.h" |
---|
| 10 | #include "internal/gc_tools.h" |
---|
| 11 | #include "internal/globals.h" |
---|
| 12 | #include "internal/object_header.h" |
---|
| 13 | #include "internal/state.h" |
---|
[d67a9a1] | 14 | #include "tools/worklist.h" |
---|
[e47f529] | 15 | |
---|
| 16 | inline bool gc_is_managed(void* address) |
---|
| 17 | { |
---|
| 18 | return gc_is_in_heap(gc_get_state(), address); |
---|
| 19 | } |
---|
| 20 | |
---|
[6be0cf9] | 21 | inline gc_object_header* gc_get_object_ptr(void* ptr) |
---|
[e47f529] | 22 | { |
---|
| 23 | void* clean = gc_get_aligned_ptr(ptr); |
---|
[6be0cf9] | 24 | return ((gc_object_header*)clean) - 1; |
---|
[e47f529] | 25 | } |
---|
| 26 | |
---|
[d67a9a1] | 27 | inline gc_memory_pool* gc_pool_of(void* address) |
---|
[e47f529] | 28 | { |
---|
| 29 | return (struct gc_memory_pool*)(((intptr_t)address) & POOL_PTR_MASK); |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | inline void gc_conditional_collect() |
---|
| 33 | { |
---|
| 34 | if(gc_needs_collect(gc_get_state())) |
---|
| 35 | { |
---|
| 36 | gc_collect(gc_get_state()); |
---|
| 37 | } |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | gcpointer_t** gc_find_previous_ref(gcpointer_t* target); |
---|
| 41 | |
---|
| 42 | void* gc_allocate(size_t size); |
---|
| 43 | |
---|
| 44 | void gc_process_reference(void** ref, worklist_t* worklist); |
---|
| 45 | |
---|
| 46 | struct gc_object_header* gc_copy_object(struct gc_object_header* ptr); |
---|
| 47 | |
---|
| 48 | void gc_scan_object(struct gc_object_header* object, worklist_t* worklist); |
---|
Note: See
TracBrowser
for help on using the repository browser.