You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
C backend: list reconstruction leaks 16 bytes per call in 2.0.24 #970
The command above compiled the original test harness; the harness and allocation probe are omitted here for brevity. repro.bend below is the reduced function to inspect, not a standalone executable.
Calling rebox with a fresh singleton containing Scalar, then fully consuming the result, leaks 16 bytes per call. The same test with Pair does not leak. Expected: neither variant accumulates unreachable allocations.
Measured in-use bytes over four iterations: Scalar 1072 → 1088 → 1104 → 1120; Pair 1056 → 1056 → 1056 → 1056. These measurements subtract allocator free-list storage, so this is not RSS growth or allocator retention.
In the generated C, the original two-word list cell is reused when boxing Pair, but neither reused nor freed when boxing Scalar. Both branches allocate a new output list cell, leaving the original 16 bytes orphaned in the Scalar case.
Activity
A List Cons spare survives val_box over a sum: Pair no longer steals …
A List Cons spare survives val_box over a sum: Pair no longer steals …