Repository navigation
Commit 01d980d
committed
hg_malloc: report free as the room left to carve, not size minus live
free was size minus the live figure, which reads ~95% available on a
256M arena regardless of load and barely moves. Worse, it is optimistic
in the direction that matters: carved-but-recycled cells are reusable
only within their own size class, so free can report hundreds of MB
while an allocation of a different size fails outright.
Report the uncarved remainder instead, which is what actually predicts
that failure. free + real_used no longer sums to size (real_used is the
live figure); free + carve does. The three figures now answer three
different questions rather than two of them being redundant.1 parent dae0ae8 commit 01d980d
2 files changed
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
| 464 | + | |
| 465 | + | |
465 | 466 | | |
466 | 467 | | |
467 | 468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
444 | 452 | | |
445 | 453 | | |
446 | 454 | | |
| |||
0 commit comments