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

Scopes + memory groundwork #273

Merged
merged 295 commits into from
Apr 14, 2024
Merged

Scopes + memory groundwork #273

merged 295 commits into from
Apr 14, 2024

Conversation

dphfox
Copy link
Owner

@dphfox dphfox commented Sep 2, 2023

Partially implements #269. This PR introduces some groundwork for future memory management changes, and introduces basic support for the 'scoped' memory management pattern (https://fluff.blog/2023/08/30/the-next-ten-years-beyond-maids.html, https://github.com/dphfox/scoped).

  • Move all memory management utilities into a dedicated Memory folder
  • Rename cleanup to doCleanup for consistency (Fusion.cleanup should be renamed #237)
  • Add destroy methods to all objects
  • Add type information for destroy methods on objects
  • Add cleanup tables as first parameters to all constructors
  • Warn when scopes mismatch for things expected to have the same lifetime
  • Implement scoped() syntax sugar for cleanup tables w/ constructor methods
  • Generate inner scopes for state objects
  • Ensure type checking mostly passes for additions, and note where it does not currently work so it can be targeted for future PRs
  • Update unit tests
  • Update API reference
  • Update examples
  • Update tutorials

@dphfox
Copy link
Owner Author

dphfox commented Nov 26, 2023

I think it'd be useful to pull in concepts from #220 for the backend implementation of the For objects. This won't be exposed to users yet - and it probably wouldn't be the final implementation because of #205 - but it'll be useful for tidying up those rat's nests and ensuring they have consistent destruction and memory management.

@dphfox
Copy link
Owner Author

dphfox commented Nov 27, 2023

Working on debugging the unified internal For implementation now.

@dphfox
Copy link
Owner Author

dphfox commented Nov 27, 2023

Now disposing of unused processors at the right time :)

image

@dphfox
Copy link
Owner Author

dphfox commented Nov 28, 2023

image

New For object implementations are now passing unit tests.

@dphfox dphfox marked this pull request as ready for review April 14, 2024 12:58
@dphfox dphfox merged commit bcc190c into main Apr 14, 2024
@dphfox dphfox deleted the gvd-scopes branch April 14, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Generalised value destruction Fusion.cleanup should be renamed
2 participants