(svn r15569) -Codechange: replace MallocT + memset( 0 ) calls by CallocT

This commit is contained in:
smatz
2009-02-24 21:32:23 +00:00
parent 34bfb35105
commit 1f42f44092
3 changed files with 6 additions and 15 deletions

View File

@@ -55,10 +55,7 @@ bool OldMemoryPoolBase::AddBlockToPool()
this->blocks = ReallocT(this->blocks, this->current_blocks + 1);
/* Allocate memory to the new block item */
this->blocks[this->current_blocks] = MallocT<byte>(this->item_size * (1 << this->block_size_bits));
/* Clean the content of the new block */
memset(this->blocks[this->current_blocks], 0, this->item_size * (1 << this->block_size_bits));
this->blocks[this->current_blocks] = CallocT<byte>(this->item_size * (1 << this->block_size_bits));
/* Call a custom function if defined (e.g. to fill indexes) */
if (this->new_block_proc != NULL) this->new_block_proc(this->current_blocks * (1 << this->block_size_bits));