From 93b4dcf43428f410014c6f230b4839d9de4990c9 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Mon, 20 Jan 2020 14:06:26 +0100 Subject: [PATCH] Add skeleton for GlobalAlloc implementation --- src/allocator/fixed_size_block.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/allocator/fixed_size_block.rs b/src/allocator/fixed_size_block.rs index df97a118..7e8acaf3 100644 --- a/src/allocator/fixed_size_block.rs +++ b/src/allocator/fixed_size_block.rs @@ -1,4 +1,5 @@ -use alloc::alloc::Layout; +use super::Locked; +use alloc::alloc::{GlobalAlloc, Layout}; use core::ptr; /// The block sizes to use. @@ -50,3 +51,13 @@ impl FixedSizeBlockAllocator { } } } + +unsafe impl GlobalAlloc for Locked { + unsafe fn alloc(&self, layout: Layout) -> *mut u8 { + todo!(); + } + + unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { + todo!(); + } +}