Skip to content

Add heap information as primitive and to debugger#351

Draft
abelstuker wants to merge 13 commits intoTOPLLab:mainfrom
abelstuker:feat/heap-size-primitive
Draft

Add heap information as primitive and to debugger#351
abelstuker wants to merge 13 commits intoTOPLLab:mainfrom
abelstuker:feat/heap-size-primitive

Conversation

@abelstuker
Copy link
Copy Markdown
Contributor

@abelstuker abelstuker commented Apr 13, 2026

This PR introduces heap usage introspection by:

  • Adding a new heap_used primitive
  • Exposing heap usage in the debugger output (via dump or inspect)

Comment thread src/Debug/debugger.cpp Outdated
ioState,
overridesState};
overridesState,
heapState};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While having some knowledge about the current memory usage of the VM (including remotely) can be useful through inspection, I don't think it needs to be part of snapshots. Snapshots are used to serialize the state of the VM and restore it somewhere else, the current heap usage is not something you can restore.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 96def91!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You did remove it from the array, but did not reduce the length of the array, possibly causing undefined behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh wow yes sorry, will fix

Comment thread src/Debug/debugger.cpp
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.

3 participants