Skip to content

Commit

Permalink
Fixes regression in minAddressHint() refactoring, which lazily initia…
Browse files Browse the repository at this point in the history
…lizes pageSize. So, we must not use roundUpToPage() before calling minAddressHint(). This is okay, because sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto(...) does the rounding anyway.
  • Loading branch information
marceltaeumel committed Jul 12, 2021
1 parent ee88a81 commit 4ce584b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions platforms/win32/vm/sqWin32SpurAlloc.c
Expand Up @@ -83,7 +83,7 @@ sqAllocateMemory(usqInt minHeapSize, usqInt desiredHeapSize)
#endif

alloc = sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto
(roundUpToPage(desiredHeapSize), minAddressHint(), &allocBytes);
(desiredHeapSize, minAddressHint(), &allocBytes);
if (!alloc) {
sqMessageBox(MB_OK | MB_ICONSTOP, TEXT("VM Error:"),
TEXT("sqAllocateMemory: initial alloc failed!\n"));
Expand Down Expand Up @@ -225,7 +225,7 @@ allocateJITMemory(usqInt *desiredSize)
sqInt allocBytes;

char *alloc = sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto
(roundUpToPage(*desiredSize), minAddressHint(), &allocBytes);
(*desiredSize, minAddressHint(), &allocBytes);

if (!alloc) {
perror("Could not allocate JIT memory");
Expand Down

0 comments on commit 4ce584b

Please sign in to comment.