diff options
author | ck <qt-info@nokia.com> | 2009-10-26 15:53:33 +0100 |
---|---|---|
committer | ck <qt-info@nokia.com> | 2009-10-26 15:53:33 +0100 |
commit | 11706165a24fd74672f088636055518591cf7f77 (patch) | |
tree | c5fd1e1ecc71398429d699aaec12105eff122ad7 /src/shared/cplusplus/MemoryPool.h | |
parent | 0edf1b48a6ea3e2271c21f97d573b649b4ca9a12 (diff) | |
parent | bac9c64f938d25788f5cdebf39aa5342788a5087 (diff) | |
download | qt-creator-11706165a24fd74672f088636055518591cf7f77.tar.gz |
Merge branch 'master' of scm.dev.nokia.troll.no:creator/mainline
Diffstat (limited to 'src/shared/cplusplus/MemoryPool.h')
-rw-r--r-- | src/shared/cplusplus/MemoryPool.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/shared/cplusplus/MemoryPool.h b/src/shared/cplusplus/MemoryPool.h index e0f1ff8701..5b6fae925f 100644 --- a/src/shared/cplusplus/MemoryPool.h +++ b/src/shared/cplusplus/MemoryPool.h @@ -79,6 +79,22 @@ public: return allocate_helper(size); } + struct State + { + char *ptr; + char *end; + int blockCount; + + inline bool isValid() const + { return ptr != 0; } + + inline State(char *ptr = 0, int blockCount = 0) + : ptr(ptr), blockCount(blockCount) {} + }; + + State state() const; + void rewind(const State &state); + private: void *allocate_helper(size_t size); |