fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>;
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout);
来自https://doc.rust-lang.org/std/alloc/trait.Allocator.html
我还注意到,相比之下,GlobalAlloc*mut u8
一致使用https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html
unsafe fn alloc(&self, layout: Layout) -> *mut u8;
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout);