Changing and fixing some stuff

- QHash is better to use than QMap in MemoryManager: faster lookups, able to reserve memory in advance
- Also: reserve memory in advance for the QVector and QHash, so we don't get needles allocs for them
- No need to do cleanup for the nph manager, as it uses the generic manager for allocs, and that already gets cleaned up
This commit is contained in:
Vesa
2014-08-24 13:38:48 +03:00
parent 42e67d27a1
commit 8fb8c683f9
5 changed files with 4 additions and 13 deletions

View File

@@ -29,7 +29,7 @@
#include <new>
#include <QtCore/QVector>
#include <QtCore/QMutex>
#include <QtCore/QMap>
#include <QtCore/QHash>
#include "MemoryHelper.h"
@@ -83,7 +83,7 @@ struct PtrInfo
};
typedef QVector<MemoryPool> MemoryPoolVector;
typedef QMap<void*, PtrInfo> PointerInfoMap;
typedef QHash<void*, PtrInfo> PointerInfoMap;
class MemoryManager
{

View File

@@ -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;