summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-03-31 23:07:02 +0100
committerDamien George <damien.p.george@gmail.com>2015-04-03 14:11:13 +0100
commit12ab9eda8dcebb166679cb3b2e8b61facedced68 (patch)
tree1d2ab79029655a22c3ef57f19bbcd1df64550f5c /py
parent3f327cc4c61bf7d55a0299009d5f6d3f38e66937 (diff)
downloadmicropython-12ab9eda8dcebb166679cb3b2e8b61facedced68.tar.gz
micropython-12ab9eda8dcebb166679cb3b2e8b61facedced68.zip
py: Make heap printing compatible with 16-bit word size.
Diffstat (limited to 'py')
-rw-r--r--py/gc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/py/gc.c b/py/gc.c
index 86db78f84e..7e9b2c53c0 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -680,10 +680,11 @@ void gc_dump_alloc_table(void) {
}
}
// print header for new line of blocks
+ // (the cast to uint32_t is for 16-bit ports)
#if EXTENSIVE_HEAP_PROFILING
- printf("\n%05x: ", (uint)(bl * BYTES_PER_BLOCK) & 0xfffff);
+ printf("\n%05x: ", (uint)((bl * BYTES_PER_BLOCK) & (uint32_t)0xfffff));
#else
- printf("\n%05x: ", (uint)PTR_FROM_BLOCK(bl) & 0xfffff);
+ printf("\n%05x: ", (uint)(PTR_FROM_BLOCK(bl) & (uint32_t)0xfffff));
#endif
}
int c = ' ';