Skip to content

Commit

Permalink
Calculate new memory pool size with macro
Browse files Browse the repository at this point in the history
  • Loading branch information
kala13x committed Nov 18, 2024
1 parent aa67ab5 commit 0cbc429
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/sys/pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ void *XPool_Alloc(xpool_t *pPool, size_t nSize)
// Create new pool if next is not found
if (pPool->pNext == NULL)
{
size_t nNewSize = nSize > pPool->nSize ?
nSize : pPool->nSize;

size_t nNewSize = XSTD_MAX(nSize, pPool->nSize);
pPool->pNext = XPool_Create(nNewSize);
if (pPool->pNext == NULL) return NULL;
}
Expand Down

0 comments on commit 0cbc429

Please sign in to comment.