Skip to content

Commit fefa7a6

Browse files
committed
Fix required memory size passed to expunge()
The size passed to expunge() must match the size passed to find_block().
1 parent f26d563 commit fefa7a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apc_sma.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ PHP_APCU_API void *apc_sma_malloc_ex(apc_sma_t *sma, size_t n, size_t *allocated
449449

450450
/* Expunge cache in hope of freeing up memory, but only once */
451451
if (!nuked) {
452-
sma->expunge(*sma->data, n+fragment);
452+
sma->expunge(*sma->data, ALIGNWORD(n + ALIGNWORD(sizeof(struct block_t))));
453453
nuked = 1;
454454
goto restart;
455455
}

0 commit comments

Comments
 (0)