File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -434,8 +434,14 @@ void *gc_realloc(void *ptr, machine_uint_t n_bytes) {
434434 if (n_bytes <= n_existing ) {
435435 return ptr ;
436436 } else {
437- // TODO check if we can grow inplace
438- void * ptr2 = gc_alloc (n_bytes );
437+ // TODO false is incorrect! Should get value from current block!
438+ void * ptr2 = gc_alloc (n_bytes ,
439+ #if MICROPY_ENABLE_FINALISER
440+ FTB_GET (BLOCK_FROM_PTR ((machine_uint_t )ptr ))
441+ #else
442+ false
443+ #endif
444+ );
439445 if (ptr2 == NULL ) {
440446 return ptr2 ;
441447 }
@@ -444,7 +450,8 @@ void *gc_realloc(void *ptr, machine_uint_t n_bytes) {
444450 return ptr2 ;
445451 }
446452}
447- #endif
453+
454+ #else // Alternative gc_realloc impl
448455
449456void * gc_realloc (void * ptr_in , machine_uint_t n_bytes ) {
450457 if (gc_lock_depth > 0 ) {
@@ -524,6 +531,7 @@ void *gc_realloc(void *ptr_in, machine_uint_t n_bytes) {
524531
525532 return ptr_out ;
526533}
534+ #endif // Alternative gc_realloc impl
527535
528536void gc_dump_info () {
529537 gc_info_t info ;
You can’t perform that action at this time.
0 commit comments