faster gc

This commit is contained in:
2026-02-14 16:46:11 -06:00
parent e75596ce30
commit 5fe05c60d3
13 changed files with 7566 additions and 7521 deletions

View File

@@ -1082,6 +1082,11 @@ struct JSContext {
uint8_t *heap_end; /* end of block */
size_t current_block_size; /* current block size (64KB initially) */
size_t next_block_size; /* doubles if <10% recovered after GC */
int gc_poor_streak; /* consecutive poor-recovery GC cycles */
/* GC stats (lightweight, always on) */
uint64_t gc_count; /* number of GC cycles */
uint64_t gc_bytes_copied; /* total bytes copied across all GCs */
/* Constant text pool — compilation constants */
uint8_t *ct_base; /* pool base */