瀏覽代碼

CodePageAllocator::AllocPages should pass thru the page count instead of have fix 1 page.o

During refactoring the page count was copy and paste there.  Since the caller only call with value 1 currently, it doesn't cause any functional issue.  But the request size should be honor when the API is used with different page count in the future.
Curtis Man 10 年之前
父節點
當前提交
84005401e2
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      lib/Common/Memory/CustomHeap.h

+ 3 - 3
lib/Common/Memory/CustomHeap.h

@@ -191,13 +191,13 @@ public:
         return address;
     }
 
-    char * AllocPages(size_t pages, void ** pageSegment, bool canAllocInPreReservedHeapPageSegment, bool isAnyJittedCode, bool * isAllJITCodeInPreReservedRegion)
+    char * AllocPages(uint pages, void ** pageSegment, bool canAllocInPreReservedHeapPageSegment, bool isAnyJittedCode, bool * isAllJITCodeInPreReservedRegion)
     {
         Assert(this->cs.IsLocked());
         char * address = nullptr;
         if (canAllocInPreReservedHeapPageSegment)
         {
-            address = this->preReservedHeapPageAllocator.AllocPages(1, (PageSegmentBase<PreReservedVirtualAllocWrapper>**)pageSegment);
+            address = this->preReservedHeapPageAllocator.AllocPages(pages, (PageSegmentBase<PreReservedVirtualAllocWrapper>**)pageSegment);
 
             if (address == nullptr)
             {
@@ -211,7 +211,7 @@ public:
             {
                 *isAllJITCodeInPreReservedRegion = false;
             }
-            address = this->pageAllocator.AllocPages(1, (PageSegmentBase<VirtualAllocWrapper>**)pageSegment);
+            address = this->pageAllocator.AllocPages(pages, (PageSegmentBase<VirtualAllocWrapper>**)pageSegment);
         }
         else
         {