From 066c2825a6233d8c435f77471856ecf94d2f6047 Mon Sep 17 00:00:00 2001 From: Max Lingua Date: Sat, 18 Jan 2014 00:12:49 -0500 Subject: PS2: converted malloc(x) -> memalign(64, x) --- backends/platform/ps2/Gs2dScreen.cpp | 2 +- backends/platform/ps2/icon.cpp | 2 +- backends/platform/ps2/irxboot.cpp | 6 +++--- backends/platform/ps2/systemps2.cpp | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'backends/platform/ps2') diff --git a/backends/platform/ps2/Gs2dScreen.cpp b/backends/platform/ps2/Gs2dScreen.cpp index c1d6b6e5ac..d478805e82 100644 --- a/backends/platform/ps2/Gs2dScreen.cpp +++ b/backends/platform/ps2/Gs2dScreen.cpp @@ -378,7 +378,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height) { ee_thread_t animThread, thisThread; ReferThreadStatus(GetThreadId(), &thisThread); - _animStack = malloc(ANIM_STACK_SIZE); + _animStack = memalign(64, ANIM_STACK_SIZE); animThread.initial_priority = thisThread.current_priority - 3; animThread.stack = _animStack; animThread.stack_size = ANIM_STACK_SIZE; diff --git a/backends/platform/ps2/icon.cpp b/backends/platform/ps2/icon.cpp index bda4843647..22c546231c 100644 --- a/backends/platform/ps2/icon.cpp +++ b/backends/platform/ps2/icon.cpp @@ -937,7 +937,7 @@ uint16 PS2Icon::decompressData(uint16 **data) { uint16 inPos = 1; const uint16 *rleData = (const uint16 *)_rleIcoData; uint16 resSize = rleData[0]; - uint16 *resData = (uint16 *)malloc(resSize * sizeof(uint16)); + uint16 *resData = (uint16 *)memalign(64, resSize * sizeof(uint16)); uint16 outPos = 0; while (outPos < resSize) { diff --git a/backends/platform/ps2/irxboot.cpp b/backends/platform/ps2/irxboot.cpp index ee52687d95..dcdf404fbe 100644 --- a/backends/platform/ps2/irxboot.cpp +++ b/backends/platform/ps2/irxboot.cpp @@ -150,7 +150,7 @@ int loadIrxModules(int device, const char *irxPath, IrxReference **modules, IrxT irxFiles = irxType[type]; numFiles = numIrx[type]; - resModules = (IrxReference *)malloc(numFiles * sizeof(IrxReference)); + resModules = (IrxReference *)memalign(64, numFiles * sizeof(IrxReference)); curModule = resModules; for (int i = 0; i < numFiles; i++) { @@ -160,7 +160,7 @@ int loadIrxModules(int device, const char *irxPath, IrxReference **modules, IrxT if ((irxFiles[i].flags & TYPEMASK) == BIOS) { curModule->loc = IRX_FILE; - curModule->path = (char *)malloc(32); + curModule->path = (char *)memalign(64, 32); sprintf(curModule->path, "rom0:%s", irxFiles[i].name); curModule->buffer = NULL; curModule->size = 0; @@ -169,7 +169,7 @@ int loadIrxModules(int device, const char *irxPath, IrxReference **modules, IrxT curModule->errorCode = 0; } else { curModule->loc = IRX_BUFFER; - curModule->path = (char *)malloc(256); + curModule->path = (char *)memalign(64, 256); sprintf(curModule->path, "%s%s%s", irxPath, irxFiles[i].name, (device == CD_DEV) ? ";1" : ""); int fd = fioOpen(curModule->path, O_RDONLY); diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp index ed1c437f01..e19aa46abc 100644 --- a/backends/platform/ps2/systemps2.cpp +++ b/backends/platform/ps2/systemps2.cpp @@ -329,7 +329,7 @@ OSystem_PS2::OSystem_PS2(const char *elfPath) { // _screen->wantAnim(true); - _bootPath = (char *)malloc(128); + _bootPath = (char *)memalign(64, 128); _bootDevice = detectBootPath(elfPath, _bootPath); if (_bootDevice != HOST_DEV) { @@ -456,8 +456,8 @@ void OSystem_PS2::initTimer(void) { ee_thread_t timerThread, soundThread, thisThread; ReferThreadStatus(GetThreadId(), &thisThread); - _timerStack = (uint8 *)malloc(TIMER_STACK_SIZE); - _soundStack = (uint8 *)malloc(SOUND_STACK_SIZE); + _timerStack = (uint8 *)memalign(64, TIMER_STACK_SIZE); + _soundStack = (uint8 *)memalign(64, SOUND_STACK_SIZE); // give timer thread a higher priority than main thread timerThread.initial_priority = thisThread.current_priority - 1; @@ -1030,7 +1030,7 @@ void OSystem_PS2::makeConfigPath() { src = ps2_fopen("cdfs:ScummVM.ini", "r"); if (src) { size = ((Ps2File *)src)->size(); - buf = (char *)malloc(size); + buf = (char *)memalign(64, size); ps2_fread(buf, size, 1, src); ps2_fclose(src); -- cgit v1.2.3