2004-05-23 21:25:59 +00:00
|
|
|
/*===-- GCInterface.h - Public interface exposed by garbage collectors ----===*\
|
|
|
|
|*
|
|
|
|
|* The LLVM Compiler Infrastructure
|
|
|
|
|*
|
|
|
|
|* This file was developed by the LLVM research group and is distributed under
|
|
|
|
|* the University of Illinois Open Source License. See LICENSE.TXT for details.
|
2005-04-21 23:48:37 +00:00
|
|
|
|*
|
2004-05-23 21:25:59 +00:00
|
|
|
|*===----------------------------------------------------------------------===*|
|
2005-04-21 23:48:37 +00:00
|
|
|
|*
|
2004-05-23 21:25:59 +00:00
|
|
|
|* This file defines the common public interface that must be exposed by all
|
|
|
|
|* LLVM garbage collectors.
|
|
|
|
|*
|
|
|
|
\*===----------------------------------------------------------------------===*/
|
|
|
|
|
|
|
|
#ifndef GCINTERFACE_H
|
|
|
|
#define GCINTERFACE_H
|
|
|
|
|
2004-05-27 05:51:13 +00:00
|
|
|
/* llvm_cg_walk_gcroots - This function is exposed by the LLVM code generator,
|
|
|
|
* and allows us to traverse the roots on the stack.
|
|
|
|
*/
|
|
|
|
void llvm_cg_walk_gcroots(void (*FP)(void **Root, void *Meta));
|
|
|
|
|
|
|
|
|
2004-05-23 21:25:59 +00:00
|
|
|
/* llvm_gc_initialize - This function is called to initalize the garbage
|
|
|
|
* collector.
|
|
|
|
*/
|
2004-05-27 05:51:13 +00:00
|
|
|
void llvm_gc_initialize(unsigned InitialHeapSize);
|
2004-05-23 21:25:59 +00:00
|
|
|
|
|
|
|
/* llvm_gc_allocate - This function allocates Size bytes from the heap and
|
|
|
|
* returns a pointer to it.
|
|
|
|
*/
|
|
|
|
void *llvm_gc_allocate(unsigned Size);
|
|
|
|
|
|
|
|
/* llvm_gc_collect - This function forces a garbage collection cycle.
|
|
|
|
*/
|
|
|
|
void llvm_gc_collect();
|
|
|
|
|
|
|
|
/* llvm_gc_read - This function should be implemented to include any read
|
|
|
|
* barrier code that is needed by the garbage collector.
|
|
|
|
*/
|
2004-07-22 05:51:13 +00:00
|
|
|
void *llvm_gc_read(void *ObjPtr, void **FieldPtr);
|
2004-05-23 21:25:59 +00:00
|
|
|
|
|
|
|
/* llvm_gc_write - This function should be implemented to include any write
|
|
|
|
* barrier code that is needed by the garbage collector.
|
|
|
|
*/
|
2004-07-22 05:51:13 +00:00
|
|
|
void llvm_gc_write(void *V, void *ObjPtr, void **FieldPtr);
|
2004-05-23 21:25:59 +00:00
|
|
|
|
|
|
|
#endif
|