Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: give access to used memory in the zkvm #2089

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

leruaa
Copy link
Contributor

@leruaa leruaa commented Feb 25, 2025

Motivation

For benchmarks it would be useful to have a way to access the memory usage in the zkvm, when using the bump global allocator

Solution

Adding a used_memory() function that returns the used memory.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@@ -15,6 +15,10 @@
// Memory addresses must be lower than BabyBear prime.
pub const MAX_MEMORY: usize = 0x78000000;

// Pointer to next heap address to use, or 0 if the heap has not yet been
// initialized.
static mut HEAP_POS: usize = 0;
Copy link
Member

Choose a reason for hiding this comment

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

Gate behind bump feature flag?

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