I'm trying to do my own memory allocation with the alloc crate. The way I implemented it, and if I understand how the Layout works, the below line should get the size I want to allocate in bytes as the first argument, and a value to round to for the second. So in my example, I would like to allocate 20 bytes, which will be rounded to 4096 since I passed it that value. Then alloc will allocate that memory and return a pointer to the start of my allocation.
let pr = alloc(Layout::from_size_align(20, 4096).unwrap());
Is my understanding of the functionality correct? Also, is there any way to check if the number of bytes specified have been allocated or not?