ADT
aaron-thesis
arm-eh
ast-experimental
cleanup-dtors
deferred_resn
enum
forall-pointer-decay
jacob/cs343-translation
jenkins-sandbox
new-ast
new-ast-unique-expr
no_list
persistent-indexer
pthread-emulation
qualifiedEnum
Last change
on this file since bcb14b5 was bf71cfd, checked in by Thierry Delisle <tdelisle@…>, 7 years ago |
Moved up many directories in source
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[e47f529] | 1 | #pragma once
|
---|
| 2 |
|
---|
[76af36f] | 3 | #include <stdlib.h>
|
---|
[e47f529] | 4 |
|
---|
[385c130] | 5 | #include "tools.h"
|
---|
[eb38dd5] | 6 | //
|
---|
[385c130] | 7 | #include "gcpointers.h"
|
---|
[29ad0ac] | 8 | #include "state.h"
|
---|
| 9 | #include "internal/gc_tools.h"
|
---|
[385c130] | 10 | #include "internal/globals.h"
|
---|
| 11 | #include "internal/object_header.h"
|
---|
| 12 | #include "internal/state.h"
|
---|
[d67a9a1] | 13 | #include "tools/worklist.h"
|
---|
[e47f529] | 14 |
|
---|
[16cfd8c] | 15 | static inline bool gc_is_managed(void* address)
|
---|
[29ad0ac] | 16 | {
|
---|
| 17 | return gc_is_in_heap(gc_get_state(), address);
|
---|
| 18 | }
|
---|
| 19 |
|
---|
[16cfd8c] | 20 | static inline gc_object_header* gc_get_object_ptr(void* ptr)
|
---|
[385c130] | 21 | {
|
---|
| 22 | void* clean = gc_get_aligned_ptr(ptr);
|
---|
| 23 | return ((gc_object_header*)clean) - 1;
|
---|
| 24 | }
|
---|
[29ad0ac] | 25 |
|
---|
[16cfd8c] | 26 | static inline struct gc_memory_pool* gc_pool_of(void* address)
|
---|
[385c130] | 27 | {
|
---|
| 28 | return (struct gc_memory_pool*)(((intptr_t)address) & POOL_PTR_MASK);
|
---|
| 29 | }
|
---|
| 30 |
|
---|
[16cfd8c] | 31 | static inline void gc_conditional_collect()
|
---|
[385c130] | 32 | {
|
---|
| 33 | if(gc_needs_collect(gc_get_state()))
|
---|
| 34 | {
|
---|
| 35 | gc_collect(gc_get_state());
|
---|
| 36 | }
|
---|
| 37 | }
|
---|
| 38 |
|
---|
| 39 | gcpointer_t** gc_find_previous_ref(gcpointer_t* target);
|
---|
| 40 |
|
---|
| 41 | void* gc_allocate(size_t size);
|
---|
| 42 |
|
---|
| 43 | void gc_process_reference(void** ref, worklist_t* worklist);
|
---|
| 44 |
|
---|
| 45 | struct gc_object_header* gc_copy_object(struct gc_object_header* ptr);
|
---|
| 46 |
|
---|
| 47 | void gc_scan_object(struct gc_object_header* object, worklist_t* worklist);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.