summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@nokia.com>2010-03-18 16:06:29 +0100
committerErik Verbruggen <erik.verbruggen@nokia.com>2010-03-18 16:06:29 +0100
commitf6d7927003e609a9c5640e38ebcb05012758dfc6 (patch)
treeb9f7964a6464bf2a2cec3966669216280067cf63 /src/shared/cplusplus
parentbfa1693629aa6056b0cd9d21f90b0caeeb9bc9bb (diff)
downloadqt-creator-f6d7927003e609a9c5640e38ebcb05012758dfc6.tar.gz
Got rid of the memset.
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r--src/shared/cplusplus/MemoryPool.cpp14
-rw-r--r--src/shared/cplusplus/MemoryPool.h4
2 files changed, 1 insertions, 17 deletions
diff --git a/src/shared/cplusplus/MemoryPool.cpp b/src/shared/cplusplus/MemoryPool.cpp
index 56c9673200..585f8e250b 100644
--- a/src/shared/cplusplus/MemoryPool.cpp
+++ b/src/shared/cplusplus/MemoryPool.cpp
@@ -53,8 +53,7 @@
using namespace CPlusPlus;
MemoryPool::MemoryPool()
- : _initializeAllocatedMemory(true),
- _blocks(0),
+ : _blocks(0),
_allocatedBlocks(0),
_blockCount(-1),
_ptr(0),
@@ -79,12 +78,6 @@ void MemoryPool::reset()
_ptr = _end = 0;
}
-bool MemoryPool::initializeAllocatedMemory() const
-{ return _initializeAllocatedMemory; }
-
-void MemoryPool::setInitializeAllocatedMemory(bool initializeAllocatedMemory)
-{ _initializeAllocatedMemory = initializeAllocatedMemory; }
-
void *MemoryPool::allocate_helper(size_t size)
{
assert(size < BLOCK_SIZE);
@@ -106,9 +99,6 @@ void *MemoryPool::allocate_helper(size_t size)
if (! block)
block = (char *) std::malloc(BLOCK_SIZE);
- if (_initializeAllocatedMemory)
- std::memset(block, '\0', BLOCK_SIZE);
-
_ptr = block;
_end = _ptr + BLOCK_SIZE;
@@ -130,8 +120,6 @@ RecursiveMemoryPool::~RecursiveMemoryPool()
_pool->_blockCount = _blockCount;
_pool->_ptr = _ptr;
_pool->_end = _end;
-
- std::memset(_pool->_ptr, 0, _pool->_end - _pool->_ptr);
}
Managed::Managed()
diff --git a/src/shared/cplusplus/MemoryPool.h b/src/shared/cplusplus/MemoryPool.h
index 6299c57c22..8156e5c321 100644
--- a/src/shared/cplusplus/MemoryPool.h
+++ b/src/shared/cplusplus/MemoryPool.h
@@ -66,9 +66,6 @@ public:
MemoryPool();
~MemoryPool();
- bool initializeAllocatedMemory() const;
- void setInitializeAllocatedMemory(bool initializeAllocatedMemory);
-
void reset();
inline void *allocate(size_t size)
@@ -86,7 +83,6 @@ private:
void *allocate_helper(size_t size);
private:
- bool _initializeAllocatedMemory;
char **_blocks;
int _allocatedBlocks;
int _blockCount;