adjusted the memory pool size of t-009.c

This commit is contained in:
hyung-hwan 2025-06-15 17:22:53 +09:00
parent 9d18c2ce2a
commit 846cbcf951
2 changed files with 5 additions and 5 deletions

View File

@ -653,7 +653,7 @@ void* hawk_xma_realloc (hawk_xma_t* xma, void* b, hawk_oow_t size)
{ {
void* n; void* n;
if (b == HAWK_NULL) if (!b)
{ {
/* 'realloc' with NULL is the same as 'alloc' */ /* 'realloc' with NULL is the same as 'alloc' */
n = hawk_xma_alloc(xma, size); n = hawk_xma_alloc(xma, size);
@ -661,9 +661,9 @@ void* hawk_xma_realloc (hawk_xma_t* xma, void* b, hawk_oow_t size)
else else
{ {
/* try reallocation by merging the adjacent continuous blocks */ /* try reallocation by merging the adjacent continuous blocks */
#if defined(HAWK_XMA_ENABLE_STAT) #if defined(HAWK_XMA_ENABLE_STAT)
xma->stat.nreallocops++; xma->stat.nreallocops++;
#endif #endif
n = _realloc_merge(xma, b, size); n = _realloc_merge(xma, b, size);
if (!n) if (!n)
{ {

View File

@ -44,7 +44,7 @@ int main()
double malloc_time = 0.0, free_time = 0.0; double malloc_time = 0.0, free_time = 0.0;
no_plan(); no_plan();
hawk_init_xma_mmgr(&xma_mmgr, NUM_OPERATIONS * MAX_ALLOC_SIZE); hawk_init_xma_mmgr(&xma_mmgr, 20000000);
srand((unsigned int)time(NULL)); srand((unsigned int)time(NULL));
start_time = clock(); start_time = clock();