mirror of
https://github.com/powdr-labs/powdr.git
synced 2026-04-20 03:03:25 -04:00
Merge pull request #778 from powdr-labs/zeroed_allocation
Providing alloc_zeroed instead of using default implementation.
This commit is contained in:
@@ -27,6 +27,10 @@ impl<const SIZE: usize> FixedMemoryAllocator<SIZE> {
|
||||
|
||||
unsafe impl<const SIZE: usize> GlobalAlloc for FixedMemoryAllocator<SIZE> {
|
||||
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
||||
self.alloc_zeroed(layout)
|
||||
}
|
||||
|
||||
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 {
|
||||
// Start address of the allocation array:
|
||||
let array_start = addr_of!(self.mem_buffer) as usize;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user