summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-06-13 22:33:31 +0100
committerDamien George <damien.p.george@gmail.com>2014-06-13 22:33:31 +0100
commitc03769495778bad118b3c59d3cbd05c417e40b9e (patch)
treee66cd625ddb74f505263711e89e03e129f6083c1
parent63b223732349fe5991e284cd71e9b5c409500d16 (diff)
downloadmicropython-c03769495778bad118b3c59d3cbd05c417e40b9e.tar.gz
micropython-c03769495778bad118b3c59d3cbd05c417e40b9e.zip
py, gc: Revert ret_ptr to void*, casting to byte* for memset.
-rw-r--r--py/gc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/gc.c b/py/gc.c
index 452736b6df..30bae5054a 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -400,14 +400,14 @@ found:
}
// get pointer to first block
- byte *ret_ptr = (byte*)(gc_pool_start + start_block * WORDS_PER_BLOCK);
+ void *ret_ptr = (void*)(gc_pool_start + start_block * WORDS_PER_BLOCK);
// zero out the additional bytes of the newly allocated blocks
// This is needed because the blocks may have previously held pointers
// to the heap and will not be set to something else if the caller
// doesn't actually use the entire block. As such they will continue
// to point to the heap and may prevent other blocks from being reclaimed.
- memset(ret_ptr + n_bytes, 0, (end_block - start_block + 1) * BYTES_PER_BLOCK - n_bytes);
+ memset((byte*)ret_ptr + n_bytes, 0, (end_block - start_block + 1) * BYTES_PER_BLOCK - n_bytes);
#if MICROPY_ENABLE_FINALISER
if (has_finaliser) {