2013-10-21 18:45:08 -04:00
|
|
|
void gc_init(void *start, void *end);
|
2014-04-08 07:31:21 -04:00
|
|
|
|
|
|
|
// These lock/unlock functions can be nested.
|
|
|
|
// They can be used to prevent the GC from allocating/freeing.
|
|
|
|
void gc_lock(void);
|
|
|
|
void gc_unlock(void);
|
|
|
|
|
|
|
|
// A given port must implement gc_collect by using the other collect functions.
|
|
|
|
void gc_collect(void);
|
2013-10-23 15:20:17 -04:00
|
|
|
void gc_collect_start(void);
|
2013-10-21 18:45:08 -04:00
|
|
|
void gc_collect_root(void **ptrs, machine_uint_t len);
|
2013-10-23 15:20:17 -04:00
|
|
|
void gc_collect_end(void);
|
2014-04-08 07:31:21 -04:00
|
|
|
|
2014-04-05 15:35:48 -04:00
|
|
|
void *gc_alloc(machine_uint_t n_bytes, bool has_finaliser);
|
2013-10-22 15:26:36 -04:00
|
|
|
void gc_free(void *ptr);
|
|
|
|
machine_uint_t gc_nbytes(void *ptr);
|
2013-10-21 18:45:08 -04:00
|
|
|
void *gc_realloc(void *ptr, machine_uint_t n_bytes);
|
2013-10-22 10:25:25 -04:00
|
|
|
|
|
|
|
typedef struct _gc_info_t {
|
|
|
|
machine_uint_t total;
|
|
|
|
machine_uint_t used;
|
|
|
|
machine_uint_t free;
|
|
|
|
machine_uint_t num_1block;
|
|
|
|
machine_uint_t num_2block;
|
|
|
|
machine_uint_t max_block;
|
|
|
|
} gc_info_t;
|
|
|
|
|
|
|
|
void gc_info(gc_info_t *info);
|
2014-02-11 16:53:34 -05:00
|
|
|
void gc_dump_info(void);
|
2014-02-26 17:55:59 -05:00
|
|
|
void gc_dump_alloc_table(void);
|