Revert "py: Add ability to manually mark blocks during collect."
This reverts commit 9321828158
.
This commit is contained in:
parent
2042aad126
commit
05c14dfe78
10
py/gc.c
10
py/gc.c
|
@ -405,16 +405,6 @@ void gc_info(gc_info_t *info) {
|
||||||
GC_EXIT();
|
GC_EXIT();
|
||||||
}
|
}
|
||||||
|
|
||||||
void gc_mark_block(void * ptr) {
|
|
||||||
if (VERIFY_PTR(ptr)) {
|
|
||||||
size_t _block = BLOCK_FROM_PTR(ptr);
|
|
||||||
if (ATB_GET_KIND(_block) == AT_HEAD) {
|
|
||||||
/* an unmarked head, mark it, and push it on gc stack */
|
|
||||||
ATB_HEAD_TO_MARK(_block);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void *gc_alloc(size_t n_bytes, bool has_finaliser) {
|
void *gc_alloc(size_t n_bytes, bool has_finaliser) {
|
||||||
size_t n_blocks = ((n_bytes + BYTES_PER_BLOCK - 1) & (~(BYTES_PER_BLOCK - 1))) / BYTES_PER_BLOCK;
|
size_t n_blocks = ((n_bytes + BYTES_PER_BLOCK - 1) & (~(BYTES_PER_BLOCK - 1))) / BYTES_PER_BLOCK;
|
||||||
DEBUG_printf("gc_alloc(" UINT_FMT " bytes -> " UINT_FMT " blocks)\n", n_bytes, n_blocks);
|
DEBUG_printf("gc_alloc(" UINT_FMT " bytes -> " UINT_FMT " blocks)\n", n_bytes, n_blocks);
|
||||||
|
|
3
py/gc.h
3
py/gc.h
|
@ -45,9 +45,6 @@ void gc_collect_start(void);
|
||||||
void gc_collect_root(void **ptrs, size_t len);
|
void gc_collect_root(void **ptrs, size_t len);
|
||||||
void gc_collect_end(void);
|
void gc_collect_end(void);
|
||||||
|
|
||||||
// During a collect, use this to mark blocks used in C but allocated using gc_alloc.
|
|
||||||
void gc_mark_block(void * ptr);
|
|
||||||
|
|
||||||
void *gc_alloc(size_t n_bytes, bool has_finaliser);
|
void *gc_alloc(size_t n_bytes, bool has_finaliser);
|
||||||
void gc_free(void *ptr); // does not call finaliser
|
void gc_free(void *ptr); // does not call finaliser
|
||||||
size_t gc_nbytes(const void *ptr);
|
size_t gc_nbytes(const void *ptr);
|
||||||
|
|
Loading…
Reference in New Issue