summaryrefslogtreecommitdiff
path: root/src/oldpool.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/oldpool.h')
-rw-r--r--src/oldpool.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/oldpool.h b/src/oldpool.h
index 46d31e999..e8081fa82 100644
--- a/src/oldpool.h
+++ b/src/oldpool.h
@@ -292,6 +292,18 @@ protected:
{
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;
+ }
};