How to create a fixed array on the heap?
I've not used Rust much and I'm getting stuck a bit using the type Box<[u32;1024]>, I can't figure out how I'm supposed to directly allocate and zero initialise this without copying it from the stack or using a vector or something which feels wrong.
I essentially just want the equivalent to:
// let page: Box<[u32; 1024]> = ? uint32_t *page = calloc(sizeof(uint32_t), 1024); 12 posts - 6 participants
原文:https://www.a8q9.cn/en/article/how-to-create-a-fixed-array-on-the-heap-626c32.html