diff options
author | George Hazan <george.hazan@gmail.com> | 2015-01-18 18:55:32 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-01-18 18:55:32 +0000 |
commit | ffed014ccd5370a5073594d55dd0dc88080e0b3d (patch) | |
tree | 6d8c5c00d7d5e22607e55aa5ce73c1e2b8139044 /src/modules/database/mdatabasecache.cpp | |
parent | cdad72e9512d163ed15bc89bd0a93e7da2ee4c50 (diff) |
contacts cache details to be completely hidden from the outside world
git-svn-id: http://svn.miranda-ng.org/main/trunk@11873 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/database/mdatabasecache.cpp')
-rw-r--r-- | src/modules/database/mdatabasecache.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/database/mdatabasecache.cpp b/src/modules/database/mdatabasecache.cpp index 3cc8be5972..27283ebb8d 100644 --- a/src/modules/database/mdatabasecache.cpp +++ b/src/modules/database/mdatabasecache.cpp @@ -34,7 +34,8 @@ static int compareGlobals(const DBCachedGlobalValue *p1, const DBCachedGlobalVal return strcmp(p1->name, p2->name);
}
-MDatabaseCache::MDatabaseCache() :
+MDatabaseCache::MDatabaseCache(size_t _size) :
+ m_contactSize(_size),
m_lSettings(100, stringCompare),
m_lContacts(50, NumericKeySortT),
m_lGlobalSettings(50, compareGlobals)
@@ -60,7 +61,7 @@ DBCachedContact* MDatabaseCache::AddContactToCache(MCONTACT contactID) if (index != -1)
return m_lContacts[index];
- DBCachedContact *cc = (DBCachedContact*)HeapAlloc(m_hCacheHeap, HEAP_ZERO_MEMORY, sizeof(DBCachedContact));
+ DBCachedContact *cc = (DBCachedContact*)HeapAlloc(m_hCacheHeap, HEAP_ZERO_MEMORY, m_contactSize);
cc->contactID = contactID;
cc->nSubs = -1;
m_lContacts.insert(cc);
|