Include padding in heap size calculation (#3197)

Closes #3005
This commit is contained in:
DemiMarie-parity
2019-07-25 04:36:11 -04:00
committed by Bastian Köcher
parent e12587b5ef
commit cfd4ac75ad
+2 -1
View File
@@ -67,7 +67,6 @@ impl FreeingBumpHeapAllocator {
let current_size: Bytes = mem.current_size().into();
let current_size = current_size.0 as u32;
let used_size = mem.used_size().0 as u32;
let heap_size = current_size - used_size;
let mut ptr_offset = used_size;
let padding = ptr_offset % ALIGNMENT;
@@ -75,6 +74,8 @@ impl FreeingBumpHeapAllocator {
ptr_offset += ALIGNMENT - padding;
}
let heap_size = current_size - ptr_offset;
FreeingBumpHeapAllocator {
bumper: 0,
heads: [0; N],