Inplace it!
Place small arrays on the stack with a low cost!
The only price you should pay for this is the price of choosing
a type based on the size of the requested array! This is just one match
!
What?
This crate is created for one purpose: allocating small arrays on the stack. The simplest way to use it is:
use inplace_array;
inplace_array
You can also place copy of some array.
use inplace_copy_of;
let source = ;
inplace_copy_of;
You can also place uninitialized array. This operation is faster because of it haven't initializing overhead but you should use it with care.
use inplace_array_uninitialized;
unsafe
Why?
Because allocation on the stack (i.e. placing variables) is MUCH FASTER then usual allocating in the heap.
Moar!
You can read the API reference for more details or create an new issue to submit a bug, feature request or just ask a question.
Changelog
0.2.2
-
Fixed drop-correctness for safe functions.
Now unsafe function do not drop your data but safe function do it correctly.