[Scummvm-cvs-logs] SF.net SVN: scummvm:[43990] scummvm/trunk/common/memorypool.cpp
tramboi at users.sourceforge.net
tramboi at users.sourceforge.net
Sun Sep 6 15:26:15 CEST 2009
Revision: 43990
http://scummvm.svn.sourceforge.net/scummvm/?rev=43990&view=rev
Author: tramboi
Date: 2009-09-06 13:26:14 +0000 (Sun, 06 Sep 2009)
Log Message:
-----------
COMMON: (Inactive) code to debug memory leaks in memory pools + typo fix
Modified Paths:
--------------
scummvm/trunk/common/memorypool.cpp
Modified: scummvm/trunk/common/memorypool.cpp
===================================================================
--- scummvm/trunk/common/memorypool.cpp 2009-09-06 13:05:49 UTC (rev 43989)
+++ scummvm/trunk/common/memorypool.cpp 2009-09-06 13:26:14 UTC (rev 43990)
@@ -46,6 +46,12 @@
}
MemoryPool::~MemoryPool() {
+#if 0
+ freeUnusedPages();
+ if (!_pages.empty())
+ warning("Memory leak found in pool");
+#endif
+
for (size_t i = 0; i < _pages.size(); ++i)
::free(_pages[i].start);
}
@@ -62,7 +68,7 @@
_pages.push_back(page);
- // Next time, we'll alocate a page twice as big as this one.
+ // Next time, we'll allocate a page twice as big as this one.
_chunksPerPage *= 2;
// Add the page to the pool of free chunk
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list