Description
Current status
Final incarnation of std::heap
is being proposed in rust-lang/rfcs#1974, hopefully for stabilization thereafter.
Open questions for stabilization are:
-
Is it required to deallocate with the exact size that you allocate with? With the
usable_size
business we may wish to allow, for example, that you if you allocate with(size, align)
you must deallocate with a size somewhere in the range ofsize...usable_size(size, align)
. It appears that jemalloc is totally ok with this (doesn't require you to deallocate with a precisesize
you allocate with) and this would also allowVec
to naturally take advantage of the excess capacity jemalloc gives it when it does an allocation. (although actually doing this is also somewhat orthogonal to this decision, we're just empoweringVec
). So far @gankro has most of the thoughts on this. -
Is it required to deallocate with the exact
align
that you allocate with? Concerns have been raised that allocatores like jemalloc don't require this, and it's difficult to envision an allocator that does require this. (more discussion). @ruuda and @rkruppe look like they've got the most thoughts so far on this.
Original report
This is a tracking issue for the unstable APIs related to allocation. Today this encompasses:
alloc
heap_api
oom
This largely involves just dealing with the stabilization of liballoc itself, but it needs to address issues such as:
- Are we willing to stabilize the exact interface of the allocation API as-is today?
- Do we want to stabilize custom allocators?
- Do we want to stabilize a standalone allocation library,
liballoc
? - Should
oom
be a generally available piece of functionality, and should it be pluggable?
This will likely take a good deal of work to stabilize, and this may be done piecemeal, but this issue should serve as a location for tracking at least these unstable features.