Nick Fitzgerald

Results 394 comments of Nick Fitzgerald

Not sure it is worth copying more of `std` here, rather than just waiting for the allocator API to stabilize.

I doubt that lifetime variance has any effect on optimizations. AFAIK that's all erased by the time code goes to LLVM, and I'd expect that any `rustc` optimizations for `Box`...

We should do whatever `std` does. When I ported `Vec` over, it didn't have a generic allocator yet, so it makes sense that things have diverged. We should reconverge them.

I *think* this was taken from `std` but it looks like `std`'s example is different now (if it was actually taken from there). Happy to receive a PR to fix...

Not sure it is worth fixing this old forked `std` code. Would probably be better to either * Update to new forked `std` code, which presumably has been fixed and...

I would be open to reviewing and merging a PR that implements this functionality. We should also have quickchecks that set random allocation limits, allocate from the bump and assert...

Thanks for making this pull request and giving us an idea of what changes are required to support generic backing allocators in `bumpalo`. > Could you please tell me if...

You can perhaps do something like ```rust let x = arena.alloc(x); let x = x as &mut dyn Debug; let x = unsafe { BumpBox::from_raw(x) }; ``` Otherwise, you can...

Unfortunately it is impossible to make a generic version of that snippet in today's Rust: 1. A function can't be generic over a trait, rather than over a type, so...

Yes, this is an incorrect test. It is true that this allocation will always cause the bump pointer to overflow inside `try_alloc_layout_fast`, but then we return `None` there and in...