src/oldpool.h
changeset 10314 9cfcdd5b5ddb
parent 9343 c30fd350dd8c
child 10316 6878402fa6e5
--- a/src/oldpool.h	Wed Apr 23 20:22:31 2008 +0000
+++ b/src/oldpool.h	Wed Apr 23 20:56:08 2008 +0000
@@ -292,6 +292,18 @@
 	{
 		return Tpool->CleaningPool();
 	}
+
+public:
+	/**
+	 * Check whether we can allocate an item in this pool. This to prevent the
+	 * need to actually construct the object and then destructing it again,
+	 * which could be *very* costly.
+	 * @return true if and only if at least ONE item can be allocated.
+	 */
+	static inline bool CanAllocateItem()
+	{
+		return AllocateRaw() != NULL;
+	}
 };