diff --git a/include/MemoryManager.h b/include/MemoryManager.h index e1df35e20..5ff2d34ff 100644 --- a/include/MemoryManager.h +++ b/include/MemoryManager.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "MemoryHelper.h" @@ -83,7 +83,7 @@ struct PtrInfo }; typedef QVector MemoryPoolVector; -typedef QMap PointerInfoMap; +typedef QHash PointerInfoMap; class MemoryManager { diff --git a/include/NotePlayHandle.h b/include/NotePlayHandle.h index 94581f82e..15efb82aa 100644 --- a/include/NotePlayHandle.h +++ b/include/NotePlayHandle.h @@ -330,7 +330,6 @@ public: NotePlayHandle::Origin origin = NotePlayHandle::OriginPattern ); static void release( NotePlayHandle * nph ); static void extend( int i ); - static void cleanup(); private: static NotePlayHandleList s_nphCache; diff --git a/src/core/MemoryManager.cpp b/src/core/MemoryManager.cpp index c901d9bf2..83a7942ae 100644 --- a/src/core/MemoryManager.cpp +++ b/src/core/MemoryManager.cpp @@ -37,6 +37,8 @@ QMutex MemoryManager::s_pointerMutex; bool MemoryManager::init() { + s_memoryPools.reserve( 64 ); + s_pointerInfo.reserve( 4096 ); // construct first MemoryPool and allocate memory MemoryPool m ( MM_INITIAL_CHUNKS ); m.m_pool = MemoryHelper::alignedMalloc( MM_INITIAL_CHUNKS * MM_CHUNK_SIZE ); diff --git a/src/core/NotePlayHandle.cpp b/src/core/NotePlayHandle.cpp index 694703571..fc8e33f4c 100644 --- a/src/core/NotePlayHandle.cpp +++ b/src/core/NotePlayHandle.cpp @@ -612,12 +612,3 @@ void NotePlayHandleManager::extend( int i ) } s_mutex.unlock(); } - - -void NotePlayHandleManager::cleanup() -{ - foreach( NotePlayHandle * n, s_nphCache ) - { - delete n; - } -} diff --git a/src/core/main.cpp b/src/core/main.cpp index 6b4481f78..5b3b72a4a 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -538,7 +538,6 @@ int main( int argc, char * * argv ) // cleanup memory managers MemoryManager::cleanup(); - NotePlayHandleManager::cleanup(); return( ret ); }