diff --git a/build/systemMenu_RED/misc/src/cmn.c b/build/systemMenu_RED/misc/src/cmn.c index 333fac13..6cc10d44 100644 --- a/build/systemMenu_RED/misc/src/cmn.c +++ b/build/systemMenu_RED/misc/src/cmn.c @@ -39,9 +39,6 @@ void CMN_InitFileSystem( NNSFndAllocator* pAllocator ) // ARM7との通信FIFO割り込み許可 (void)OS_EnableIrqMask(OS_IE_SPFIFO_RECV); - // ファイルシステム初期化 - FS_Init( FS_DMA_NOT_USE ); - // ファイルテーブルキャッシュ if( pAllocator != NULL ) { diff --git a/build/systemMenu_RED/misc/src/misc.c b/build/systemMenu_RED/misc/src/misc.c index 88ca0780..2e81ed3b 100644 --- a/build/systemMenu_RED/misc/src/misc.c +++ b/build/systemMenu_RED/misc/src/misc.c @@ -155,18 +155,26 @@ const u8 *const g_strWeek[] ATTRIBUTE_ALIGN(2) = { // アロケータの初期化 void InitAllocator( void ) { - NNSFndAllocator *pAllocator = &g_allocator; - u32 arenaLow = MATH_ROUNDUP ( (u32)OS_GetMainArenaLo(), 16 ); - u32 arenaHigh = MATH_ROUNDDOWN( (u32)OS_GetMainArenaHi(), 16 ); - u32 heapSize = arenaHigh - arenaLow; - void* heapMemory = OS_AllocFromMainArenaLo( heapSize, 16 ); - NNSFndHeapHandle heapHandle; - SDK_NULL_ASSERT( pAllocator ); - - heapHandle = NNS_FndCreateExpHeap( heapMemory, heapSize ); - SDK_ASSERT( heapHandle != NNS_FND_HEAP_INVALID_HANDLE ); + // ※暫定対策 FS_Init内でハッシュチェック用のヒープを確保しているため、 + // ユーザーヒープの確保前にFS_Initを行う必要がある。 - NNS_FndInitAllocatorForExpHeap( pAllocator, heapHandle, 32 ); + // ファイルシステム初期化 + FS_Init( FS_DMA_NOT_USE ); + + { + NNSFndAllocator *pAllocator = &g_allocator; + u32 arenaLow = MATH_ROUNDUP ( (u32)OS_GetMainArenaLo(), 16 ); + u32 arenaHigh = MATH_ROUNDDOWN( (u32)OS_GetMainArenaHi(), 16 ); + u32 heapSize = arenaHigh - arenaLow; + void* heapMemory = OS_AllocFromMainArenaLo( heapSize, 16 ); + NNSFndHeapHandle heapHandle; + SDK_NULL_ASSERT( pAllocator ); + + heapHandle = NNS_FndCreateExpHeap( heapMemory, heapSize ); + SDK_ASSERT( heapHandle != NNS_FND_HEAP_INVALID_HANDLE ); + + NNS_FndInitAllocatorForExpHeap( pAllocator, heapHandle, 32 ); + } }