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

[CN-Exec] Don't "leak" memory #859

Open
ZippeyKeys12 opened this issue Feb 10, 2025 · 0 comments
Open

[CN-Exec] Don't "leak" memory #859

ZippeyKeys12 opened this issue Feb 10, 2025 · 0 comments
Assignees
Labels
CN spec testing cn CN-exec Related to CN executable spec generation, called using `cn instrument` technical debt Something for internal cleanup

Comments

@ZippeyKeys12
Copy link
Collaborator

ZippeyKeys12 commented Feb 10, 2025

AFAIU

There are two types of memory allocations in Fulminate, values used for checking (precondition, postcondition), and the global state tracking ownership.

The first is a dynamically allocated stack, so the bump allocator can be used to not leak memory.

The issue is that the bump allocator is also used for the global state, so you can't just push and pop. A solution is to use a separate buffer or allocator for the global state.

However, this decreases the total memory available to the bump allocator (due to limits to the amount of static variable allocation in a single library at least on macOS). This appears to be solved by compiling them into separate libraries. It does not. I think I will figure this out at some point because it is fun to think about.

@ZippeyKeys12 ZippeyKeys12 added cn CN spec testing CN-exec Related to CN executable spec generation, called using `cn instrument` technical debt Something for internal cleanup labels Feb 10, 2025
@ZippeyKeys12 ZippeyKeys12 self-assigned this Feb 10, 2025
@ZippeyKeys12 ZippeyKeys12 changed the title [CN-Exec] Free spec variables [CN-Exec] Don't "leak" memory Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CN spec testing cn CN-exec Related to CN executable spec generation, called using `cn instrument` technical debt Something for internal cleanup
Projects
None yet
Development

No branches or pull requests

1 participant