diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-20 20:46:39 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-20 20:46:39 +0300 |
commit | 5b991ae2d3e2db32b3c77a9d140bb485a219e68d (patch) | |
tree | f6d68ad1c84ac2e7057b06b613ae2a2d0971970b | |
parent | dde739d364b0faf48e74a88b65dc2468a3aaf64b (diff) | |
download | micropython-5b991ae2d3e2db32b3c77a9d140bb485a219e68d.tar.gz micropython-5b991ae2d3e2db32b3c77a9d140bb485a219e68d.zip |
gc: gc_realloc(): Fix byte-to-block calculation.
-rw-r--r-- | py/gc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |