궁금한궁금이의 공포의 문제


1.
inline MemoryRecyclingSystem::addDumpMemory( void* _dumpMemory )
{
    if(  !memoryStore[index] )
    {
        memoryStore[index] = (void*)malloc( ( blockEndIndex + 1 ) * zl_pointersize ) ;

        *(void**)( memoryStore[ blockEndIndex ] ) = (void*)( memoryStore );
        memoryStore = (void**)( memoryStore[index] );
        memoryStore[ blockEndIndex ] = zl_nullmemory;
        index = 1;
    }

    memoryStore[index++] = (void*)( _dumpMemory );
}

2.
inline MemoryRecyclingSystem::addDumpMemory( void* _dumpMemory )
{
    if(  !memoryStore[index] )
    {
        createNewMemoryBlock();
    }

    memoryStore[index++] = (void*)( _dumpMemory );
}



1과 2중 어떤게 효율적일까? addDumpMemory 함수는 public으로 선언이 되어있으며 무조건 inline 함수이다.

2의 createNewMemoryBlock 함수는 일반 함수이며 private로 선언이 되어있다.