3 ms·
In Rust you have to create and initialize an object on the stack and then move it to the heap. This is not necessary in C.
by im3w1l 4y ago
In Rust you have to create and initialize an object on the stack and then move it to the heap. This is not necessary in C.
- pornel 4y agoThe usual safe way is to do that, and count on LLVM to eliminate the copy. However, Rust also has a MaybeUninit wrapper type for allocating uninitialized memory wherever you want and writing to it directly.