
8 Jul
2011
8 Jul
'11
9:44 a.m.
Hi, in my project I try to use boost::pool to handle memory allocation/deallocation. I have a MemoryManager object with two simple methods: void* WaveStreamMM::AllocateBuffer(size_t numbytes, int memtype) { boost::mutex::scoped_lock lock(m_mutex); void *buf = m_pool.ordered_malloc(numbytes); memset(buf, 0, numbytes); return buf; } void WaveStreamMM::FreeBuffer(void *p) { boost::mutex::scoped_lock lock(m_mutex); m_pool.free(p); } If I use the code above, the memory usage of my application increase over the time, while if I substitute the allocation/deallocation respectively with: void *buf = malloc(numbytes); and free(p); the memory usage remains constant. I wrong something? Regards, Daniele.
5058
Age (days ago)
5058
Last active (days ago)
0 comments
1 participants
participants (1)
-
Daniele Barzotti