mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-29 23:27:25 -04:00
Use separate heap for DVD decompression
This fixes crashes when first entering North Faaron cave and Renado's Sanctuary due to system heap exhaustion resulting from multiple threads allocating on the heap at once. There's some sort of weird contention going on - for some reason the game gobbles up seemingly any amount of memory you throw at it when the two threads are competing for heap space. Using a separate heap in the async thread sidesteps the issue.
This commit is contained in:
@@ -29,6 +29,10 @@
|
||||
#include "DynamicLink.h"
|
||||
#include "os_report.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#if !PLATFORM_GCN
|
||||
#include <revolution/sc.h>
|
||||
#include <revolution/wpad.h>
|
||||
@@ -991,6 +995,11 @@ int mDoMch_Create() {
|
||||
GXSetVerifyCallback((GXVerifyCallback)&myGXVerifyCallback);
|
||||
#endif
|
||||
JKRDvdRipper::setSZSBufferSize(0x4000);
|
||||
#if TARGET_PC
|
||||
JKRHeap* dvdHeap = JKRCreateExpHeap(0x10000, NULL, false);
|
||||
assert(dvdHeap != NULL);
|
||||
JKRDvdRipper::setHeap(dvdHeap);
|
||||
#endif
|
||||
JKRDvdAramRipper::setSZSBufferSize(0x4000);
|
||||
JKRAram::setSZSBufferSize(0x2000);
|
||||
mDoDvdThd::create(OSGetThreadPriority(OSGetCurrentThread()) - 2);
|
||||
|
||||
Reference in New Issue
Block a user