diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-01-15 16:11:09 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-15 16:11:09 -0800 |
| commit | 8b6133393781d84dde78115fa525ba2ec7223d5e (patch) | |
| tree | b15c20f662d9e65c5dca2bf06203b90c6ee0b80a /py | |
| parent | 765a54afb594e244a9187b9e58e18b182b5097cd (diff) | |
| parent | 85dc4089b9b2d721a3e4bfc68e252c0dda450137 (diff) | |
Merge pull request #2510 from dhalbert/bonding-nvm
nrf: Add bonding to BLE pairing support
Diffstat (limited to 'py')
| -rwxr-xr-x | py/gc.c | 4 | ||||
| -rw-r--r-- | py/gc.h | 2 |
2 files changed, 6 insertions, 0 deletions
@@ -464,6 +464,10 @@ void gc_info(gc_info_t *info) { GC_EXIT(); } +bool gc_alloc_possible(void) { + return MP_STATE_MEM(gc_pool_start) != 0; +} + // We place long lived objects at the end of the heap rather than the start. This reduces // fragmentation by localizing the heap churn to one portion of memory (the start of the heap.) void *gc_alloc(size_t n_bytes, bool has_finaliser, bool long_lived) { @@ -58,6 +58,8 @@ void gc_collect_ptr(void *ptr); void gc_collect_root(void **ptrs, size_t len); void gc_collect_end(void); +// Is the gc heap available? +bool gc_alloc_possible(void); void *gc_alloc(size_t n_bytes, bool has_finaliser, bool long_lived); // Use this function to sweep the whole heap and run all finalisers |
