aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/micropython
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdlib/micropython')
-rw-r--r--src/stdlib/micropython/lv_mem_core_micropython.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/stdlib/micropython/lv_mem_core_micropython.c b/src/stdlib/micropython/lv_mem_core_micropython.c
index 69c8bd681..a671b5e1c 100644
--- a/src/stdlib/micropython/lv_mem_core_micropython.c
+++ b/src/stdlib/micropython/lv_mem_core_micropython.c
@@ -62,17 +62,32 @@ void lv_mem_remove_pool(lv_mem_pool_t pool)
void * lv_malloc_core(size_t size)
{
+#if MICROPY_MALLOC_USES_ALLOCATED_SIZE
+ return gc_alloc(size, true);
+#else
return m_malloc(size);
+#endif
}
void * lv_realloc_core(void * p, size_t new_size)
{
+
+#if MICROPY_MALLOC_USES_ALLOCATED_SIZE
+ return gc_realloc(p, new_size, true);
+#else
return m_realloc(p, new_size);
+#endif
}
void lv_free_core(void * p)
{
+
+#if MICROPY_MALLOC_USES_ALLOCATED_SIZE
+ gc_free(p);
+
+#else
m_free(p);
+#endif
}
void lv_mem_monitor_core(lv_mem_monitor_t * mon_p)