diff options
Diffstat (limited to 'nxcomp/src/EncodeBuffer.cpp')
-rw-r--r-- | nxcomp/src/EncodeBuffer.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/nxcomp/src/EncodeBuffer.cpp b/nxcomp/src/EncodeBuffer.cpp index e112113a8..e6af38b71 100644 --- a/nxcomp/src/EncodeBuffer.cpp +++ b/nxcomp/src/EncodeBuffer.cpp @@ -70,6 +70,13 @@ EncodeBuffer::EncodeBuffer() initialSize_ = ENCODE_BUFFER_DEFAULT_SIZE; thresholdSize_ = ENCODE_BUFFER_DEFAULT_SIZE << 1; maximumSize_ = ENCODE_BUFFER_DEFAULT_SIZE << 4; + + #ifdef VALGRIND + + memset(buffer_, '\0', size_); + + #endif + } EncodeBuffer::~EncodeBuffer() @@ -101,7 +108,15 @@ void EncodeBuffer::fullReset() size_ = initialSize_; buffer_ = new unsigned char[size_ + ENCODE_BUFFER_PREFIX_SIZE + - ENCODE_BUFFER_POSTFIX_SIZE] + ENCODE_BUFFER_PREFIX_SIZE; + ENCODE_BUFFER_POSTFIX_SIZE]; + + #ifdef VALGRIND + + memset(buffer_, '\0', size_ + ENCODE_BUFFER_PREFIX_SIZE + ENCODE_BUFFER_POSTFIX_SIZE); + + #endif + + buffer_ += ENCODE_BUFFER_PREFIX_SIZE; } end_ = buffer_ + size_; |