Re:What Is in a Rust Allocator?
by pitaj on Tuesday May 07, 2024 @09:58AM
(#40285532)
The APIs do tell you how many bytes are actually allocated. For instance, in the following
You can get the length of the returned byte slice (`[u8]`) to know how many bytes were actually allocated.
[ Parent
| on HN ]
Re:What Is in a Rust Allocator?
by tialaramex on Tuesday May 07, 2024 @01:32PM
(#40288851)
That's the (nightly) Allocator::allocate, but the API we were looking at is (stable) GlobalAlloc::alloc
Yes I'm aware that I can ask how long a slice is.