From 0090db3c3cc7eb4b468333b6f738383c5c5e5f5d Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Sat, 20 Aug 2022 16:19:53 -0700 Subject: Standardize initialization reference --- src/mem/alloc.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mem/alloc.rs') diff --git a/src/mem/alloc.rs b/src/mem/alloc.rs index 4d02ddd..fcd33c2 100644 --- a/src/mem/alloc.rs +++ b/src/mem/alloc.rs @@ -478,3 +478,10 @@ unsafe impl GlobalAlloc for GrandAllocator { /// The allocator of allocators. It hands out fixed sized memory chunks. #[global_allocator] pub static ALLOCATOR: GrandAllocator = GrandAllocator{}; + +/// # Global Allocator +/// +/// Returns a borrow for the Global Allocator +pub fn alloc() -> &'static crate::mem::alloc::GrandAllocator { + &crate::mem::alloc::ALLOCATOR +} -- cgit v1.2.1