runtime: count container allocations too, not just strings #135
Reference in New Issue
Block a user
Delete Branch "feat/alloc-accounting-containers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
el #131 instrumented the four string allocators, so list- and map-heavy code reported zero allocations. A benchmark over lists would have been fitted against a flat line and passed anything.
Caught during framework work: a "linear" specimen read 0 allocs until rewritten to allocate strings. A signal that silently reads zero is worse than no signal — it produces a confident pass.
Now counted at every container allocation:
ElList/ElMapbodies, backing arrays, copy-on-write clones, and the realloc growth path.Verified on an append loop (n = 100..800):
allocs +1 per doubling = O(log n) reallocations; bytes exactly 2× per doubling = O(n). Both are what correct amortized growth looks like — and both read zero before this change.
Remaining scope stated explicitly: these cover the runtime's own allocations, not malloc inside
engram_*.cor libcurl. That's correct — the gate is for El-level complexity.