diff --git a/tflite_demo/src/allocator.rs b/tflite_demo/src/allocator.rs deleted file mode 100644 index 82959d0..0000000 --- a/tflite_demo/src/allocator.rs +++ /dev/null @@ -1,24 +0,0 @@ -use alloc::alloc::*; - -/// The global allocator type. -#[derive(Default)] -pub struct Allocator; - -unsafe impl GlobalAlloc for Allocator { - unsafe fn alloc(&self, layout: Layout) -> *mut u8 { - malloc(layout.size() as u32) as *mut u8 - } - unsafe fn dealloc(&self, ptr: *mut u8, _layout: Layout) { - free(ptr as *mut c_void); - } -} - -/// If there is an out of memory error, just panic. -#[alloc_error_handler] -fn my_allocator_error(_layout: Layout) -> ! { - panic!("out of memory"); -} - -/// The static global allocator. -#[global_allocator] -static GLOBAL_ALLOCATOR: Allocator = Allocator; \ No newline at end of file