blob: 2ae7bbe5f0ba1c6a7a39faf2d1f26a45a1046085 [file] [log] [blame]
Damiendcced922013-10-21 23:45:08 +01001void gc_init(void *start, void *end);
Damien George443e0182014-04-08 11:31:21 +00002
3// These lock/unlock functions can be nested.
4// They can be used to prevent the GC from allocating/freeing.
5void gc_lock(void);
6void gc_unlock(void);
7
8// A given port must implement gc_collect by using the other collect functions.
9void gc_collect(void);
Damien8b3a7c22013-10-23 20:20:17 +010010void gc_collect_start(void);
Damiendcced922013-10-21 23:45:08 +010011void gc_collect_root(void **ptrs, machine_uint_t len);
Damien8b3a7c22013-10-23 20:20:17 +010012void gc_collect_end(void);
Damien George443e0182014-04-08 11:31:21 +000013
Damien George12bab722014-04-05 20:35:48 +010014void *gc_alloc(machine_uint_t n_bytes, bool has_finaliser);
Damienfd8b6bc2013-10-22 20:26:36 +010015void gc_free(void *ptr);
16machine_uint_t gc_nbytes(void *ptr);
Damiendcced922013-10-21 23:45:08 +010017void *gc_realloc(void *ptr, machine_uint_t n_bytes);
Damieneefcc792013-10-22 15:25:25 +010018
19typedef struct _gc_info_t {
20 machine_uint_t total;
21 machine_uint_t used;
22 machine_uint_t free;
23 machine_uint_t num_1block;
24 machine_uint_t num_2block;
25 machine_uint_t max_block;
26} gc_info_t;
27
28void gc_info(gc_info_t *info);
Paul Sokolovsky550d8042014-02-11 23:53:34 +020029void gc_dump_info(void);
Damien Georgece1162a2014-02-26 22:55:59 +000030void gc_dump_alloc_table(void);