You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally implemented in #118, it might be possible to improve the performance of the edge case when we have a CompactString > 16MB on 32-bit systems by re-using the already allocated buffer.
the layouts [of String's buffer and our heap allocated len+data] aren't compatible
Yeah, you'll run into an issue as String's buffer is u8 aligned but the inline length is usize aligned. At a performance cost, we could store the length unaligned to make the allocated alignment 1.
The unstable Allocator trait allows requesting (though an implementation can theoretically refuse to fulfill) a change in alignment of an allocation. The stable GlobalAlloc does not.
My vote is to just copy/realloc, and put a note tl if/when Allocator is stabilized optimize it to opportunistically use a layout-adjusting realloc so the underlying allocator can avoid the copy.
Originally implemented in #118, it might be possible to improve the performance of the edge case when we have a
CompactString
> 16MB on 32-bit systems by re-using the already allocated buffer.See this comment for more detail
The text was updated successfully, but these errors were encountered: