1 // Tests that it is possible to create a global allocator in a submodule, rather than in the crate
7 alloc::{GlobalAlloc, Layout},
13 unsafe impl GlobalAlloc for MyAlloc {
14 unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
18 unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {}
25 static MY_HEAP: MyAlloc = MyAlloc; //~ ERROR global_allocator