Skip to content
Snippets Groups Projects
Commit 5b991ae2 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

gc: gc_realloc(): Fix byte-to-block calculation.

parent dde739d3
No related branches found
No related tags found
No related merge requests found
......@@ -480,7 +480,7 @@ void *gc_realloc(void *ptr_in, machine_uint_t n_bytes) {
}
// compute number of new blocks that are requested
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;
// get the number of consecutive tail blocks and
// the number of free blocks after last tail block
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment