diff options
author | Damien George <damien.p.george@gmail.com> | 2015-12-16 20:09:11 -0500 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-12-16 20:09:11 -0500 |
commit | d977d268e848c1005d9105ebb6d789fb31b06c03 (patch) | |
tree | 3431ee04fe307fc3f10e31a606e96e92e983f9b7 /py/mpstate.h | |
parent | f7782f8082b692611b5fa0bea4f7fbda8b433a7b (diff) |
py/gc: Use size_t instead of mp_uint_t to count things related to heap.
size_t is the correct type to use to count things related to the size of
the address space. Using size_t (instead of mp_uint_t) is important for
the efficiency of ports that configure mp_uint_t to larger than the
machine word size.
Diffstat (limited to 'py/mpstate.h')
-rw-r--r-- | py/mpstate.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/py/mpstate.h b/py/mpstate.h index e9e38606e..c7604e03a 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -48,7 +48,7 @@ typedef struct _mp_state_mem_t { #endif byte *gc_alloc_table_start; - mp_uint_t gc_alloc_table_byte_len; + size_t gc_alloc_table_byte_len; #if MICROPY_ENABLE_FINALISER byte *gc_finaliser_table_start; #endif @@ -56,8 +56,8 @@ typedef struct _mp_state_mem_t { byte *gc_pool_end; int gc_stack_overflow; - mp_uint_t gc_stack[MICROPY_ALLOC_GC_STACK_SIZE]; - mp_uint_t *gc_sp; + size_t gc_stack[MICROPY_ALLOC_GC_STACK_SIZE]; + size_t *gc_sp; uint16_t gc_lock_depth; // This variable controls auto garbage collection. If set to 0 then the @@ -65,10 +65,10 @@ typedef struct _mp_state_mem_t { // you can still allocate/free memory and also explicitly call gc_collect. uint16_t gc_auto_collect_enabled; - mp_uint_t gc_last_free_atb_index; + size_t gc_last_free_atb_index; #if MICROPY_PY_GC_COLLECT_RETVAL - mp_uint_t gc_collected; + size_t gc_collected; #endif } mp_state_mem_t; |