-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
A-collectionsArea: `std::collections`Area: `std::collections`
Description
I think this is small enough not to need a RFC.
Just as we have both box and heap::allocate, Arena has a safe method to construct an object of a fixed-size type, but should also have an unsafe method to allocate an arbitrary number of bytes. This is what alloc_copy_inner currently does (used for types without a destructor), but it is private. It should be made public (and unsafe?) and given a more descriptive name.
It would be nice to have functionality such as custom destructors and a safe way to allocate DSTs in an Arena, but those would require, respectively, some refactoring and placement new in the language. What this issue is asking for, however, is a simple change that doesn't require design work.
Metadata
Metadata
Assignees
Labels
A-collectionsArea: `std::collections`Area: `std::collections`