Skip to content
Snippets Groups Projects
Commit 9d24e615 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Use alloc_aligned and free functions in platform for global allocator

parent 706a8de7
No related branches found
No related tags found
No related merge requests found
...@@ -13,11 +13,11 @@ pub struct Allocator; ...@@ -13,11 +13,11 @@ pub struct Allocator;
unsafe impl<'a> GlobalAlloc for Allocator { unsafe impl<'a> GlobalAlloc for Allocator {
unsafe fn alloc(&self, layout: Layout) -> *mut u8 { unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
dlmemalign(layout.align(), layout.size()) as *mut u8 alloc_align(layout.size(), layout.align()) as *mut u8
} }
unsafe fn dealloc(&self, ptr: *mut u8, _layout: Layout) { unsafe fn dealloc(&self, ptr: *mut u8, _layout: Layout) {
dlfree(ptr as *mut c_void) free(ptr as *mut c_void)
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment