Loading...
Loading...
Guide for debugging and fixing bugs in the OCaml garbage collector, particularly memory management issues in the runtime's sweeping and allocation code. This skill applies when working on OCaml runtime C code, investigating segfaults in GC operations, or fixing pointer arithmetic bugs in memory managers with size-classed pools and run-length encoding.
npx skill4agent add letta-ai/skills fix-ocaml-gcHACKING.adocINSTALLMakefilemakeworld# Initial configuration
./configure
# Full build (may take 10+ minutes)
make world
# Incremental rebuild after changes
makeruntime/shared_heap.cruntime/major_gc.cruntime/minor_gc.cruntime/memory.cruntime/gc_ctrl.cwosizewosize// INCORRECT: Using header size for pool blocks
p += Whsize_hd(hd); // May read repurposed field
// CORRECT: Using known block size for size-classed pools
p += wh; // Use the fixed size class widthwhwosizeWhsize_hd(hd)# Run basic tests (use quotes for DIR variable)
make -C testsuite DIR='tests/basic' allDIR='tests/basic'DIR=tests/basic# Search for similar pointer arithmetic patterns
grep -n "Whsize_hd" runtime/*.c
grep -n "+= wh" runtime/*.c