summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-09-23 18:10:17 +0100
committerDamien George <damien.p.george@gmail.com>2014-09-25 15:49:26 +0100
commitb0261341d3706329ea58d8fc1a5ff9c788c9ccf7 (patch)
tree97aed92dcb6bcf516c258ea56d525f1ed7d4c50f /py/runtime.c
parentac04a8a56a1591ddbaf6558b8eab9837a7d2f3cb (diff)
py: For malloc and vstr functions, use size_t exclusively for int type.
It seems most sensible to use size_t for measuring "number of bytes" in malloc and vstr functions (since that's what size_t is for). We don't use mp_uint_t because malloc and vstr are not Micro Python specific.
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 0db8093bc..403e98c7c 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -1146,8 +1146,8 @@ void mp_globals_set(mp_obj_dict_t *d) {
dict_globals = d;
}
-void *m_malloc_fail(int num_bytes) {
- DEBUG_printf("memory allocation failed, allocating %d bytes\n", num_bytes);
+void *m_malloc_fail(size_t num_bytes) {
+ DEBUG_printf("memory allocation failed, allocating " UINT_FMT " bytes\n", num_bytes);
nlr_raise((mp_obj_t)&mp_const_MemoryError_obj);
}