summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/InlineAllocator.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-04-21 16:36:08 +0000
committerAlan Conway <aconway@apache.org>2008-04-21 16:36:08 +0000
commita60ccdc6df3acd461c7e33c983d649563e4fbdc7 (patch)
treee5058f48d40958a0c4ecdaecfc675a875ea3f21d /cpp/src/qpid/InlineAllocator.h
parent61647950e1c4e6b1efb0a1b3f3b220783680103f (diff)
downloadqpid-python-a60ccdc6df3acd461c7e33c983d649563e4fbdc7.tar.gz
src/qpid/RangeSet.h: generic set implementation using ranges.
- no heap allocation for simple sets (<= 3 ranges) - binary searches for o(log(n)) performance in complex sets git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@650198 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/InlineAllocator.h')
-rw-r--r--cpp/src/qpid/InlineAllocator.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/cpp/src/qpid/InlineAllocator.h b/cpp/src/qpid/InlineAllocator.h
index 0bb30fa1a4..fd652aca03 100644
--- a/cpp/src/qpid/InlineAllocator.h
+++ b/cpp/src/qpid/InlineAllocator.h
@@ -23,6 +23,7 @@
*/
#include <memory>
+#include <assert.h>
namespace qpid {
@@ -49,7 +50,10 @@ class InlineAllocator : public BaseAllocator {
}
void deallocate(pointer p, size_type n) {
- if (p == store) allocated=false;
+ if (p == store) {
+ assert(allocated);
+ allocated=false;
+ }
else BaseAllocator::deallocate(p, n);
}