aboutsummaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-08-20 16:19:53 -0700
committerChristian Cunningham <cc@localhost>2022-08-20 16:19:53 -0700
commit0090db3c3cc7eb4b468333b6f738383c5c5e5f5d (patch)
tree2ee23249dbdfa0297f0e975465bb91c5a14b8783 /src/mem
parentf537d12e5e82b3e0e54c8894cbf0bd3dc85c5a04 (diff)
Standardize initialization reference
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/alloc.rs7
1 files changed, 7 insertions, 0 deletions
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
+}