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.
This commit is contained in:
Damien George
2014-09-23 18:10:17 +01:00
parent ac04a8a56a
commit b0261341d3
5 changed files with 80 additions and 101 deletions

View File

@@ -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);
}