diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-04-08 11:31:21 +0000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-04-08 11:31:21 +0000 |
| commit | 443e018a3f3720bcea3cee34fcde1033d9a8a218 (patch) | |
| tree | 1fb328ae987f1064b06038c63b36300911a1a7ef /py/gc.h | |
| parent | ff5639fd4230dd6c13be01288e88e9d0d4647afb (diff) | |
py: Improve GC locking/unlocking, and make it part of the API.
Diffstat (limited to 'py/gc.h')
| -rw-r--r-- | py/gc.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,8 +1,16 @@ void gc_init(void *start, void *end); + +// 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); void gc_collect_start(void); void gc_collect_root(void **ptrs, machine_uint_t len); void gc_collect_end(void); -void gc_collect(void); + void *gc_alloc(machine_uint_t n_bytes, bool has_finaliser); void gc_free(void *ptr); machine_uint_t gc_nbytes(void *ptr); |
