Allocate with fballoc (fallback allocator):
(&mut self, layout: Layout)
| 50 | |
| 51 | // Allocate with fballoc (fallback allocator): |
| 52 | fn fballoc(&mut self, layout: Layout) -> *mut u8 |
| 53 | { |
| 54 | match self.fballoc.allocate_first_fit(layout) |
| 55 | { |
| 56 | Ok(ptr) => ptr.as_ptr(), |
| 57 | Err(_) => ptr::null_mut(), |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | unsafe impl GlobalAlloc for Locked<FixedSizeBlockAlloc> |