diff options
author | smatz <smatz@openttd.org> | 2009-02-24 21:32:23 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-02-24 21:32:23 +0000 |
commit | 425fe86a3d0325c06f6fe03d13d3f0a5d07d3470 (patch) | |
tree | b6842890c3df5a6c315f6a53554d9e071a9d0903 /src/oldpool.cpp | |
parent | d73c1fa7bfed01a187e14c4d86cde70e7121c51b (diff) | |
download | openttd-425fe86a3d0325c06f6fe03d13d3f0a5d07d3470.tar.xz |
(svn r15569) -Codechange: replace MallocT + memset( 0 ) calls by CallocT
Diffstat (limited to 'src/oldpool.cpp')
-rw-r--r-- | src/oldpool.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/oldpool.cpp b/src/oldpool.cpp index 50b1635f6..7cec9d597 100644 --- a/src/oldpool.cpp +++ b/src/oldpool.cpp @@ -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)); |