Skip to content

Commit 3d6c6de

Browse files
committed
ultrares needs 40G mem
1 parent 5d0afed commit 3d6c6de

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

Header.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,13 @@ PushSize_(memory_arena *arena, u64 size, u32 alignment_pow2 = Default_Memory_Ali
321321
{
322322
result = 0;
323323
#if defined(__APPLE__) || defined(_WIN32)
324-
printf("Push of %llu bytes failed, out of memory.\n", size);
324+
fprintf(stderr, "Push of %llu bytes failed, out of memory (arena: %llu/%llu used).\n",
325+
(unsigned long long)size, (unsigned long long)arena->currentSize, (unsigned long long)arena->maxSize);
325326
#else
326-
printf("Push of %lu bytes failed, out of memory.\n", size);
327-
#endif
328-
*((volatile u32 *)0) = 0;
327+
fprintf(stderr, "Push of %lu bytes failed, out of memory (arena: %lu/%lu used).\n",
328+
(unsigned long)size, (unsigned long)arena->currentSize, (unsigned long)arena->maxSize);
329+
#endif
330+
exit(EXIT_FAILURE);
329331
}
330332
else
331333
{

PretextMap.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,12 @@ ContrastEqualisation(void *in)
19071907
}
19081908
}
19091909
}
1910-
1910+
1911+
if (max <= min)
1912+
{
1913+
return;
1914+
}
1915+
19111916
f32 scaleFactor = 254.0f / (f32)(max - min);
19121917

19131918
ForLoop(nPixels)
@@ -2006,6 +2011,11 @@ ContrastEqualisation(void *in)
20062011
}
20072012
}
20082013

2014+
if (max <= min)
2015+
{
2016+
return;
2017+
}
2018+
20092019
scaleFactor = 255.0f / (f32)(max - min);
20102020

20112021
ForLoop(nPixels)
@@ -2422,8 +2432,7 @@ MainArgs
24222432
PrintStatus("Initializing working set mutex");
24232433
InitialiseMutex(Working_Set_rwMutex);
24242434

2425-
// *** What will the actual, required memory size be? ***
2426-
u64 memorySize = ultraRes ? 24 : (highRes ? 16 : 3);
2435+
u64 memorySize = ultraRes ? 40 : (highRes ? 16 : 3);
24272436
PrintStatus("Creating memory arena of size %lu GB", memorySize);
24282437
CreateMemoryArena(Working_Set, GigaByte(memorySize));
24292438

0 commit comments

Comments
 (0)