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

Question: allocator parameter #4

Open
nrc opened this issue Nov 2, 2022 · 2 comments
Open

Question: allocator parameter #4

nrc opened this issue Nov 2, 2022 · 2 comments

Comments

@nrc
Copy link
Owner

nrc commented Nov 2, 2022

I currently follow Vec and have an allocator type parameter with default type set to Global. However, to be useful, users of OwnedBuf also need to have such a type parameter (i.e., not use the default), and in the case of OwnedRead that inhibits using it as a trait object.

@nrc
Copy link
Owner Author

nrc commented Jan 15, 2023

The only place we use the allocator at the moment is to pass to the destructor function. If we take a closure, then the allocator could be captured maybe? Then we wouldn't need the allocator type param at all

@nrc
Copy link
Owner Author

nrc commented Jan 25, 2023

If we take a closure, then the allocator could be captured maybe?

This doesn't work without boxing the closure or allocator and we want to avoid depending on that.

I think I will remove the allocator stuff for now, and if needed we can add it later

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

No branches or pull requests

1 participant