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

Add Lua::(reset_)num_allocations API #314

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cr0sh
Copy link

@cr0sh cr0sh commented Sep 16, 2023

I was in need to track the number of memory allocations, so added an API to support this.

  • Lua::num_allocations simply returns a number of allocations invoked by Lua runtime since the runtime has been created.
  • Lua::reset_num_allocations resets the counter.

@khvzak
Copy link
Member

khvzak commented Oct 2, 2023

Thanks for the PR!

Seems the current version has breaking changes (renaming MemoryLimitNotAvailable to MemoryStatsNotAvailable) which makes it hard to include into v0.9 branch.
Wondering, would be better to keep the original error code and add a new one (Error enum is non_exhaustive so it's not breaking change).
I'm happy to merge error codes into a single one in the next major release.

@khvzak khvzak force-pushed the master branch 2 times, most recently from 94cef89 to 59b1400 Compare March 22, 2024 00:36
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.

None yet

2 participants