Skip to content

fix ghost heap accounting#728

Merged
arvidn merged 1 commit intomainfrom
heap-accounting
Mar 3, 2026
Merged

fix ghost heap accounting#728
arvidn merged 1 commit intomainfrom
heap-accounting

Conversation

@arvidn
Copy link
Contributor

@arvidn arvidn commented Mar 3, 2026

We only have a heap limit in mempool mode, so this is not consensus critical.

Currently, we subtract 1 from the heap limit to account for the 1 byte we used to pre-allocate in the allocator (for Allocator::one()). Instead, just add that as a "ghost heap" counter.

Also, make sure every way we create a new atom honors the heap limit.

And give heap_size() the same treatment as atom_count() and pair_count() already received, and separate the allocated bytes from the logical heap size.

Note

Cursor Bugbot is generating a summary for commit 84715c6. Configure here.

@arvidn arvidn force-pushed the heap-accounting branch from 84715c6 to 36e4c42 Compare March 3, 2026 11:14
@coveralls-official
Copy link

coveralls-official bot commented Mar 3, 2026

Pull Request Test Coverage Report for Build 22622192615

Details

  • 61 of 62 (98.39%) changed or added relevant lines in 2 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.05%) to 88.176%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/allocator.rs 60 61 98.36%
Files with Coverage Reduction New Missed Lines %
src/allocator.rs 2 96.93%
Totals Coverage Status
Change from base Build 22596628669: 0.05%
Covered Lines: 6883
Relevant Lines: 7806

💛 - Coveralls

@arvidn arvidn requested a review from Rigidity March 3, 2026 11:34
@arvidn arvidn force-pushed the heap-accounting branch from 36e4c42 to 9b72f5e Compare March 3, 2026 11:59
@arvidn arvidn force-pushed the heap-accounting branch from 9b72f5e to 22e666e Compare March 3, 2026 12:05
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@arvidn arvidn merged commit 12dcdf0 into main Mar 3, 2026
31 checks passed
@arvidn arvidn deleted the heap-accounting branch March 3, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants