mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 11:10:14 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user