[Scummvm-cvs-logs] scummvm master -> 7e4224e52a2202ba98dd93ffe209d231e5c1d35c

lordhoto lordhoto at gmail.com
Sun Jul 3 00:23:20 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7e4224e52a COMMON: Fix compilation when USE_HASHMAP_MEMORY_POOL is not defined.


Commit: 7e4224e52a2202ba98dd93ffe209d231e5c1d35c
    https://github.com/scummvm/scummvm/commit/7e4224e52a2202ba98dd93ffe209d231e5c1d35c
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-07-02T15:16:07-07:00

Commit Message:
COMMON: Fix compilation when USE_HASHMAP_MEMORY_POOL is not defined.

Changed paths:
    common/debug.cpp
    common/hashmap.h
    common/xmlparser.h
    engines/lastexpress/resource.h
    engines/parallaction/graphics.h
    gui/debugger.h
    video/codecs/cdtoons.cpp



diff --git a/common/debug.cpp b/common/debug.cpp
index 50f9975..9c3a93e 100644
--- a/common/debug.cpp
+++ b/common/debug.cpp
@@ -23,6 +23,7 @@
 #include "common/debug-channels.h"
 #include "common/system.h"
 #include "common/textconsole.h"
+#include "common/algorithm.h"
 
 #include <stdarg.h>	// For va_list etc.
 
diff --git a/common/hashmap.h b/common/hashmap.h
index f2a4d84..347ac1f 100644
--- a/common/hashmap.h
+++ b/common/hashmap.h
@@ -106,8 +106,9 @@ private:
 		HASHMAP_MEMORYPOOL_SIZE = HASHMAP_MIN_CAPACITY * HASHMAP_LOADFACTOR_NUMERATOR / HASHMAP_LOADFACTOR_DENOMINATOR
 	};
 
-
+#ifdef USE_HASHMAP_MEMORY_POOL
 	ObjectPool<Node, HASHMAP_MEMORYPOOL_SIZE> _nodePool;
+#endif
 
 	Node **_storage;	///< hashtable of size arrsize.
 	uint _mask;		///< Capacity of the HashMap minus one; must be a power of two of minus one
@@ -128,12 +129,20 @@ private:
 #endif
 
 	Node *allocNode(const Key &key) {
+#ifdef USE_HASHMAP_MEMORY_POOL
 		return new (_nodePool) Node(key);
+#else
+		return new Node(key);
+#endif
 	}
 
 	void freeNode(Node *node) {
 		if (node && node != HASHMAP_DUMMY_NODE)
+#ifdef USE_HASHMAP_MEMORY_POOL
 			_nodePool.deleteChunk(node);
+#else
+			delete node;
+#endif
 	}
 
 	void assign(const HM_t &map);
diff --git a/common/xmlparser.h b/common/xmlparser.h
index 40c779b..d75dc0e 100644
--- a/common/xmlparser.h
+++ b/common/xmlparser.h
@@ -31,6 +31,7 @@
 #include "common/hashmap.h"
 #include "common/hash-str.h"
 #include "common/stack.h"
+#include "common/memorypool.h"
 
 
 namespace Common {
diff --git a/engines/lastexpress/resource.h b/engines/lastexpress/resource.h
index 7dc909a..9e05a90 100644
--- a/engines/lastexpress/resource.h
+++ b/engines/lastexpress/resource.h
@@ -26,6 +26,8 @@
 #include "lastexpress/data/archive.h"
 #include "lastexpress/shared.h"
 
+#include "common/array.h"
+
 namespace LastExpress {
 
 class Background;
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h
index 2f86f36..3eea1e8 100644
--- a/engines/parallaction/graphics.h
+++ b/engines/parallaction/graphics.h
@@ -28,6 +28,7 @@
 #include "common/hashmap.h"
 #include "common/hash-str.h"
 #include "common/stream.h"
+#include "common/array.h"
 
 #include "graphics/surface.h"
 
diff --git a/gui/debugger.h b/gui/debugger.h
index b74b0d6..3a587d2 100644
--- a/gui/debugger.h
+++ b/gui/debugger.h
@@ -26,6 +26,7 @@
 #include "common/ptr.h"
 #include "common/hashmap.h"
 #include "common/hash-str.h"
+#include "common/array.h"
 
 namespace GUI {
 
diff --git a/video/codecs/cdtoons.cpp b/video/codecs/cdtoons.cpp
index 9bdc794..528cee8 100644
--- a/video/codecs/cdtoons.cpp
+++ b/video/codecs/cdtoons.cpp
@@ -24,6 +24,7 @@
 #include "common/rect.h"
 #include "common/stream.h"
 #include "common/textconsole.h"
+#include "common/array.h"
 
 namespace Video {
 






More information about the Scummvm-git-logs mailing list