From cecfaaf63e0b739fbafde959fb8dc69e500052b1 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Wed, 16 Oct 2002 04:15:18 +0000 Subject: [PATCH] Cleanups. committer: mfx 1034741718 +0000 --- src/mem.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/mem.cpp b/src/mem.cpp index d0351eae..ca200878 100644 --- a/src/mem.cpp +++ b/src/mem.cpp @@ -68,11 +68,7 @@ unsigned MemBuffer::getSize() const void MemBuffer::alloc(unsigned size, unsigned base_offset) { -#if 0 - this->dealloc(); -#else - // don't automaticlly free a used buffer -#endif + // NOTE: we don't automaticlly free a used buffer assert(alloc_ptr == NULL); assert((int)size > 0); size = base_offset + size; @@ -96,12 +92,14 @@ void MemBuffer::alloc(unsigned size) void MemBuffer::allocForCompression(unsigned uncompressed_size) { + assert((int)uncompressed_size > 0); alloc(uncompressed_size + uncompressed_size/8 + 256, 0); } void MemBuffer::allocForUncompression(unsigned uncompressed_size) { + assert((int)uncompressed_size > 0); //alloc(uncompressed_size + 3 + 512, 0); // 512 safety bytes alloc(uncompressed_size + 3, 0); // 3 bytes for asm_fast decompresion }