blob: cbf9bda422d1e79c0108a557e6c356b7b54df711 [file] [log] [blame]
Chris Lattnere6fd7762004-05-23 21:25:59 +00001/*===-- GCInterface.h - Public interface exposed by garbage collectors ----===*\
2|*
3|* The LLVM Compiler Infrastructure
4|*
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.
7|*
8|*===----------------------------------------------------------------------===*|
9|*
10|* This file defines the common public interface that must be exposed by all
11|* LLVM garbage collectors.
12|*
13\*===----------------------------------------------------------------------===*/
14
15#ifndef GCINTERFACE_H
16#define GCINTERFACE_H
17
18/* llvm_gc_initialize - This function is called to initalize the garbage
19 * collector.
20 */
21void llvm_gc_initialize();
22
23/* llvm_gc_allocate - This function allocates Size bytes from the heap and
24 * returns a pointer to it.
25 */
26void *llvm_gc_allocate(unsigned Size);
27
28/* llvm_gc_collect - This function forces a garbage collection cycle.
29 */
30void llvm_gc_collect();
31
32/* llvm_gc_read - This function should be implemented to include any read
33 * barrier code that is needed by the garbage collector.
34 */
35void *llvm_gc_read(void **P);
36
37/* llvm_gc_write - This function should be implemented to include any write
38 * barrier code that is needed by the garbage collector.
39 */
40void llvm_gc_write(void *V, void **P);
41
42#endif