Skip to content
Permalink
Browse files

malloc: no longer need to round mempool's max_sz

Since commit 465b2cf this value is rounded at compile time instead.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
  • Loading branch information...
Nicolas Pitre authored and nashif committed Jun 26, 2019
1 parent 744df1e commit d4b60d691ce63aa3a9f25b7a349824f92cd18825
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/libc/minimal/source/stdlib/malloc.c
@@ -105,7 +105,7 @@ void *realloc(void *ptr, size_t requested_size)
/* Determine size of previously allocated block by its level.
* Most likely a bit larger than the original allocation
*/
block_size = _ALIGN4(blk->pool->base.max_sz);
block_size = blk->pool->base.max_sz;
for (int i = 1; i <= blk->level; i++) {
block_size = _ALIGN4(block_size / 4);
}

0 comments on commit d4b60d6

Please sign in to comment.
You can’t perform that action at this time.