Skip to content

Commit 05c14df

Browse files
committed
Revert "py: Add ability to manually mark blocks during collect."
This reverts commit 9321828.
1 parent 2042aad commit 05c14df

2 files changed

Lines changed: 0 additions & 13 deletions

File tree

py/gc.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -405,16 +405,6 @@ void gc_info(gc_info_t *info) {
405405
GC_EXIT();
406406
}
407407

408-
void gc_mark_block(void * ptr) {
409-
if (VERIFY_PTR(ptr)) {
410-
size_t _block = BLOCK_FROM_PTR(ptr);
411-
if (ATB_GET_KIND(_block) == AT_HEAD) {
412-
/* an unmarked head, mark it, and push it on gc stack */
413-
ATB_HEAD_TO_MARK(_block);
414-
}
415-
}
416-
}
417-
418408
void *gc_alloc(size_t n_bytes, bool has_finaliser) {
419409
size_t n_blocks = ((n_bytes + BYTES_PER_BLOCK - 1) & (~(BYTES_PER_BLOCK - 1))) / BYTES_PER_BLOCK;
420410
DEBUG_printf("gc_alloc(" UINT_FMT " bytes -> " UINT_FMT " blocks)\n", n_bytes, n_blocks);

py/gc.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ void gc_collect_start(void);
4545
void gc_collect_root(void **ptrs, size_t len);
4646
void gc_collect_end(void);
4747

48-
// During a collect, use this to mark blocks used in C but allocated using gc_alloc.
49-
void gc_mark_block(void * ptr);
50-
5148
void *gc_alloc(size_t n_bytes, bool has_finaliser);
5249
void gc_free(void *ptr); // does not call finaliser
5350
size_t gc_nbytes(const void *ptr);

0 commit comments

Comments
 (0)