diff options
author | Damien <damien.p.george@gmail.com> | 2013-10-23 21:03:27 +0100 |
---|---|---|
committer | Damien <damien.p.george@gmail.com> | 2013-10-23 21:03:27 +0100 |
commit | d2c1a732e5c04fce58eec5053ad04c3f29da16ba (patch) | |
tree | 02769b4b2c3b80125d52a333fe80cacf86fd6859 /py | |
parent | 0f6545139b84f3a6ad1dab04652b7646aacc44e7 (diff) | |
download | micropython-d2c1a732e5c04fce58eec5053ad04c3f29da16ba.tar.gz micropython-d2c1a732e5c04fce58eec5053ad04c3f29da16ba.zip |
Call gc_free in gc_realloc after allocating new block.
Diffstat (limited to 'py')
-rw-r--r-- | py/gc.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -329,8 +329,10 @@ void *gc_realloc(void *ptr, machine_uint_t n_bytes) { if (n_bytes <= n_existing) { return ptr; } else { + // TODO check if we can grow inplace void *ptr2 = gc_alloc(n_bytes); memcpy(ptr2, ptr, n_existing); + gc_free(ptr); return ptr2; } } |