1 parent dde739d commit 5b991aeCopy full SHA for 5b991ae
1 file changed
py/gc.c
@@ -480,7 +480,7 @@ void *gc_realloc(void *ptr_in, machine_uint_t n_bytes) {
480
}
481
482
// compute number of new blocks that are requested
483
- machine_uint_t new_blocks = (n_bytes + BYTES_PER_BLOCK) / BYTES_PER_BLOCK;
+ machine_uint_t new_blocks = (n_bytes + BYTES_PER_BLOCK - 1) / BYTES_PER_BLOCK;
484
485
// get the number of consecutive tail blocks and
486
// the number of free blocks after last tail block
0 commit comments