summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKA/Sources
diff options
context:
space:
mode:
Diffstat (limited to 'dev/ZKA/Sources')
-rw-r--r--dev/ZKA/Sources/Heap.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/dev/ZKA/Sources/Heap.cxx b/dev/ZKA/Sources/Heap.cxx
index 1f9af6a2..cd46a80b 100644
--- a/dev/ZKA/Sources/Heap.cxx
+++ b/dev/ZKA/Sources/Heap.cxx
@@ -94,18 +94,20 @@ namespace Kernel
{
Detail::mm_alloc_init_timeout();
- auto szFix = sz;
+ auto sz_fix = sz;
- if (szFix == 0)
+ if (sz_fix == 0)
return nullptr;
- auto wrapper = kHeapPageMgr.Request(rw, user, No, szFix);
+ sz_fix += sizeof(Detail::HEAP_INFORMATION_BLOCK);
+
+ auto wrapper = kHeapPageMgr.Request(rw, user, No, sz_fix);
Detail::HEAP_INFORMATION_BLOCK_PTR heap_info_ptr =
reinterpret_cast<Detail::HEAP_INFORMATION_BLOCK_PTR>(
wrapper.VirtualAddress() + sizeof(Detail::HEAP_INFORMATION_BLOCK));
- heap_info_ptr->fHeapSize = szFix;
+ heap_info_ptr->fHeapSize = sz_fix;
heap_info_ptr->fMagic = kKernelHeapMagic;
heap_info_ptr->fCRC32 = No; // dont fill it for now.
heap_info_ptr->fHeapPtr = reinterpret_cast<UIntPtr>(heap_info_ptr) + sizeof(Detail::HEAP_INFORMATION_BLOCK);