NDS: Protection against FastRam (ITCM) allocation failure

svn-id: r32136
This commit is contained in:
Bertrand Augereau 2008-05-15 08:50:47 +00:00
parent 765f976008
commit b619c6ce19

View File

@ -2364,9 +2364,13 @@ u8 fastRamData[FAST_RAM_SIZE] ITCM_DATA;
void* fastRamAlloc(int size) {
// return malloc(size);
void* result = (void *) fastRamPointer;
void* result = fastRamPointer;
fastRamPointer += size;
return (void *) (result);
if(fastRamPointer > fastRamData + FAST_RAM_SIZE) {
consolePrintf("FastRam (ITCM) allocation failed!\n");
return NULL;
}
return result;
}
void fastRamReset() {