use pool allocator for roster manager
This commit is contained in:
parent
dd11e43325
commit
f2d7db397c
2 changed files with 5 additions and 1 deletions
|
@ -23,6 +23,8 @@
|
|||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#include <boost/pool/pool_alloc.hpp>
|
||||
#include <boost/pool/object_pool.hpp>
|
||||
#include "Swiften/Swiften.h"
|
||||
// #include "rosterstorage.h"
|
||||
|
||||
|
@ -100,7 +102,7 @@ class RosterManager {
|
|||
void sendRIE();
|
||||
void handleBuddyRosterPushResponse(Swift::ErrorPayload::ref error, const std::string &key);
|
||||
|
||||
std::map<std::string, Buddy *> m_buddies;
|
||||
std::map<std::string, Buddy *, std::less<std::string>, boost::pool_allocator< std::pair<std::string, Buddy *> > > m_buddies;
|
||||
Component *m_component;
|
||||
RosterStorage *m_rosterStorage;
|
||||
User *m_user;
|
||||
|
|
|
@ -63,6 +63,8 @@ RosterManager::~RosterManager() {
|
|||
delete buddy;
|
||||
}
|
||||
|
||||
boost::singleton_pool<boost::pool_allocator_tag, sizeof(unsigned int)>::release_memory();
|
||||
|
||||
if (m_rosterStorage)
|
||||
delete m_rosterStorage;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue