summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorDavid Lechner <david@pybricks.com>2023-03-17 13:16:06 -0500
committerDavid Lechner <david@pybricks.com>2023-03-17 13:16:06 -0500
commitfa8ebb1390549314485fc26e586573cff526807a (patch)
treea271b87166df7391eccad460ccd97be7d20e36f4 /py
parent05bb26010e4a466a82cfed179f8d8d0b406a78ca (diff)
py/obj: Add MP_NOINLINE to mp_obj_malloc_helper.
As the comment in py/obj.h says: > Implementing this as a call rather than inline saves 8 bytes per usage. So in order to get this savings, we need to tell the compiler to never inline the function. Signed-off-by: David Lechner <david@pybricks.com>
Diffstat (limited to 'py')
-rw-r--r--py/obj.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/obj.c b/py/obj.c
index eb17308fe..3b0fd171c 100644
--- a/py/obj.c
+++ b/py/obj.c
@@ -38,7 +38,7 @@
#include "py/stream.h" // for mp_obj_print
// Allocates an object and also sets type, for mp_obj_malloc{,_var} macros.
-void *mp_obj_malloc_helper(size_t num_bytes, const mp_obj_type_t *type) {
+MP_NOINLINE void *mp_obj_malloc_helper(size_t num_bytes, const mp_obj_type_t *type) {
mp_obj_base_t *base = (mp_obj_base_t *)m_malloc(num_bytes);
base->type = type;
return base;