summaryrefslogtreecommitdiffstatshomepage
path: root/py/gc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-20 19:08:46 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-20 19:08:46 +0100
commit643284fc8e7cec935f13c50ecde854932a28cee8 (patch)
tree08213b7883172644d31307f5e1a7e59ddc6ba2e9 /py/gc.c
parentff91156d3495c3583dd4ced85ceea6243a1377a2 (diff)
parent26905259d04ffa2ee9b1be2607bd680a40d8dfbe (diff)
downloadmicropython-643284fc8e7cec935f13c50ecde854932a28cee8.tar.gz
micropython-643284fc8e7cec935f13c50ecde854932a28cee8.zip
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'py/gc.c')
-rw-r--r--py/gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/gc.c b/py/gc.c
index 2930e90110..9a5f9d89bf 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -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