From 88a8043a27c3f75c7e4e52e4e8b0d47005cd6bef Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 7 Dec 2017 10:52:40 +0200 Subject: [PATCH] py/malloc: MICROPY_MEM_STATS requires MICROPY_MALLOC_USES_ALLOCATED_SIZE. Error out if they're set incompatibly. --- py/malloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py/malloc.c b/py/malloc.c index ea1d4c4b9e..818a3e57a9 100644 --- a/py/malloc.c +++ b/py/malloc.c @@ -39,6 +39,9 @@ #endif #if MICROPY_MEM_STATS +#if !MICROPY_MALLOC_USES_ALLOCATED_SIZE +#error MICROPY_MEM_STATS requires MICROPY_MALLOC_USES_ALLOCATED_SIZE +#endif #define UPDATE_PEAK() { if (MP_STATE_MEM(current_bytes_allocated) > MP_STATE_MEM(peak_bytes_allocated)) MP_STATE_MEM(peak_bytes_allocated) = MP_STATE_MEM(current_bytes_allocated); } #endif