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

mmap-backed allocator #637

Closed
wants to merge 7 commits into from
Closed

Conversation

program--
Copy link
Contributor

@program-- program-- commented Sep 14, 2023

This PR adds a utility allocator class that provides allocation over mmap'd files. In theory, this would be useful for containers that store fixed-size amounts of data (i.e. mdarray), without consuming the same amount of RAM.

Additions

  • Adds ngen::mmap_allocator<T, PoolPolicy>, which implements a STL-compatible allocator. PoolPolicy provides a policy approach for default storage locations, and potentially other things (still need to decide if it is needed...). Has a runtime-customizable backing directory.

  • Adds ngen::basic_pool, which is a filesystem pool using C's open and close. Currently defaults to the system's tmpfs.

Testing

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Target Environment support

  • Linux
  • macOS

@program-- program-- added enhancement New feature or request performance issues related to runtime performance labels Sep 14, 2023
@program-- program-- self-assigned this Sep 14, 2023
@program-- program-- marked this pull request as ready for review September 18, 2023 22:01
@program--
Copy link
Contributor Author

We may be able to close this PR actually, Boost.Interprocess provides memory mapping-based allocation, so its probably favorable to use that instead.

@program-- program-- closed this Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance issues related to runtime performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant