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

Allow user to control lifetime of Buffer object #772

Open
ltaylor16 opened this issue Jan 24, 2022 · 0 comments
Open

Allow user to control lifetime of Buffer object #772

ltaylor16 opened this issue Jan 24, 2022 · 0 comments
Assignees
Labels
App Integration Issues related to integration with applications design Issues related to design and software engineering Documentation Issues related to documentation Reviewed Sidre Issues related to Axom's 'sidre' component

Comments

@ltaylor16
Copy link
Member

Many Sidre users will never interact with Buffer objects directly. They are created as part of creating a View and released when there are no Views associated with the Buffer.

However, there are cases where the user cares about the lifetime of the Buffer. For example, they create a Buffer with createBuffer then create several Views which use consecutive blocks in the Buffer. When the Views are destroyed the user has no convenient way to preserve the Buffer.

A field should be added to the Buffer object to define ownership. When createBuffer is called by the user, ownership is set to the user. Calls to createBuffer internal to the library should set ownership to the library. Then when the last View is removed from a Buffer the View will no longer be deallocated if the user owns the Buffer.

If the Buffer is created by the library, then extracted by the user via getBuffer and used to create another View, the old semantics should still apply. This keeps the ownership model simple since only createBuffer defines user ownership.

Issue #674 should include a flag to force destruction of user owned Buffers.

When the DataStore destructor is called, all Buffers should continue to be destroyed.

@ltaylor16 ltaylor16 added the Sidre Issues related to Axom's 'sidre' component label Jan 24, 2022
@ltaylor16 ltaylor16 self-assigned this Jan 24, 2022
@rhornung67 rhornung67 added App Integration Issues related to integration with applications design Issues related to design and software engineering Documentation Issues related to documentation Reviewed labels Jan 24, 2022
@rhornung67 rhornung67 added this to the FY22 Development milestone Jan 24, 2022
@rhornung67 rhornung67 modified the milestones: FY22 Development, FY23 Development Mar 13, 2023
@rhornung67 rhornung67 modified the milestones: FY23 Development, April 2024 Release Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Integration Issues related to integration with applications design Issues related to design and software engineering Documentation Issues related to documentation Reviewed Sidre Issues related to Axom's 'sidre' component
Projects
None yet
Development

No branches or pull requests

2 participants