Skip to content

Commit 0f5bf1a

Browse files
committed
py/mpconfig.h: MP_NOINLINE is universally useful, move from unix port.
1 parent 422396c commit 0f5bf1a

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

py/mpconfig.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,11 @@ typedef double mp_float_t;
10311031
#define MP_WEAK __attribute__((weak))
10321032
#endif
10331033

1034+
// Modifier for functions which should be never inlined
1035+
#ifndef MP_NOINLINE
1036+
#define MP_NOINLINE __attribute__((noinline))
1037+
#endif
1038+
10341039
// Condition is likely to be true, to help branch prediction
10351040
#ifndef MP_LIKELY
10361041
#define MP_LIKELY(x) __builtin_expect((x), 1)

unix/mpconfigport.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,6 @@ void mp_unix_mark_exec(void);
234234
#define MP_PLAT_ALLOC_EXEC(min_size, ptr, size) mp_unix_alloc_exec(min_size, ptr, size)
235235
#define MP_PLAT_FREE_EXEC(ptr, size) mp_unix_free_exec(ptr, size)
236236

237-
#ifndef MP_NOINLINE
238-
#define MP_NOINLINE __attribute__((noinline))
239-
#endif
240-
241237
#if MICROPY_PY_OS_DUPTERM
242238
#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
243239
#else

0 commit comments

Comments
 (0)