1 /*===-- GCInterface.h - Public interface exposed by garbage collectors ----===*\
3 |* The LLVM Compiler Infrastructure
5 |* This file was developed by the LLVM research group and is distributed under
6 |* the University of Illinois Open Source License. See LICENSE.TXT for details.
8 |*===----------------------------------------------------------------------===*|
10 |* This file defines the common public interface that must be exposed by all
11 |* LLVM garbage collectors.
13 \*===----------------------------------------------------------------------===*/
18 /* llvm_cg_walk_gcroots - This function is exposed by the LLVM code generator,
19 * and allows us to traverse the roots on the stack.
21 void llvm_cg_walk_gcroots(void (*FP
)(void **Root
, void *Meta
));
24 /* llvm_gc_initialize - This function is called to initalize the garbage
27 void llvm_gc_initialize(unsigned InitialHeapSize
);
29 /* llvm_gc_allocate - This function allocates Size bytes from the heap and
30 * returns a pointer to it.
32 void *llvm_gc_allocate(unsigned Size
);
34 /* llvm_gc_collect - This function forces a garbage collection cycle.
36 void llvm_gc_collect();
38 /* llvm_gc_read - This function should be implemented to include any read
39 * barrier code that is needed by the garbage collector.
41 void *llvm_gc_read(void *ObjPtr
, void **FieldPtr
);
43 /* llvm_gc_write - This function should be implemented to include any write
44 * barrier code that is needed by the garbage collector.
46 void llvm_gc_write(void *V
, void *ObjPtr
, void **FieldPtr
);