-
Notifications
You must be signed in to change notification settings - Fork 10
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
Meeting: Nov 27, 2019 #70
Comments
action item: minimal frame allocator with bump allocation and a reset function. |
possiblity: adding "crate assumptions" metadata in crates.io or on the ecosystem guide. Eg: "uses thread local storage", "uses threads", etc |
action item assignment: I will ask around about thread pool unification. |
Started an issue for the minimal bump alloc: #71 |
"global thread pools": withoutboats posted this, which seems very related, https://twitter.com/withoutboats/status/1195030095800471552 |
Meeting is tomorrow ReminderThe meeting is scheduled for Which, because of daylight savings changes, is now 1 hour different from the time we were meeting in the summer! Updated times for some time zones:
and so on! |
(We can discuss if we should make the meeting times follow daylight savings and such, but currently the readme's stance is clear that we don't follow daylight savings) |
I implemented a bump allocator using the alloc-wg's traits. To achieve that I proposed some changes in this PR. |
aclysma wanted #44 to get some talk, it's been sitting a while will probably have to get updated some before we can merge it. |
It was just me and wodann this time. Notes:
|
@95th Nice! I had another look to see why we might have a discrepancy, but my version of the bump allocator is a generic that accepts any allocator that implements the When using a generic, the |
That static fn remained from original implementation. I have implemented alloc wg traits here so you can pass immutable reference For example: https://github.com/95th/bumpalo/blob/15aa51d51f730e7a271cc16917671dd6fdcb445c/tests/string.rs#L8 |
Is it possible for someone to summarize the meeting in terms of the alloc-wg crate? But I would also be interested to know to what extent the implemented proposals were accepted:
|
I’m skeptical the an associated error type is all that useful as a way to return additional diagnostic information. At least I haven’t seen concrete use cases, only what feels like attempts at being maximally generic out of principle. But this isn’t a strong opinion. I am opposed to the idea that every API that could ever involve allocation should always return a Even without going that far, planning to set an allocator’s associated error type to Finally, Having said that, what do you think are advantages or uses of an associated error type? |
(I thought I had recorded the meeting, but I'm a dummy and the audio settings were messed up, and so there was no audio.) So we got this methods here https://github.com/Wodann/alloc-bump-rs/blob/master/src/lib.rs#L64 which moves a T into the allocator's memory region and return the
Then when you have everything taking
I didn't get a hang of the point of In terms of associated errors, if the allocator wants to have errors be useful, just make an extension trait for it that adds a "get last error" method or something. Like an allocator should be returning |
@95th I understand that your changes allow the bumpalo Bump allocator to use the alloc-wg's At the moment, the bumpalo You can try changing your |
@TimDiekmann I hope this answers your questions.
I implemented the I also had to look at the
I didn't actually return any error information, but one might. I am impartial to having an
No complaints. I appreciate the extra guarantee. |
I think you can do something like this: impl<ChunkAlloc> AllocRef for Bump<ChunkAlloc> where ChunkAlloc: AllocRef {}
impl<ChunkAlloc> AllocRef for &Bump<&ChunkAlloc> where &ChunkAlloc: AllocRef {} Now you support concurrent access if and only if the underlying chunk allocator supports it. Perfect! |
@TimDiekmann actually now that i think about it, I'd personally like if NonZeroLayout had exactly one NonZero value, because it makes the |
I haven't done any performance checks, but as long as the underlying error type is a ZST, this should have no impact at all. |
Closing this up so we don't have too many old meetings issues. If you have more to say please feel free to open a new issue for it (if necessary) or just move discussion to a newer meeting issue. |
Action items:
@kabergstrom will championDone by @Wodann)The text was updated successfully, but these errors were encountered: