py: Disable dump_args function call entirely when not debugging.
Yes, I know, a good compiler will optimise this away, but I feel this is neater.
This commit is contained in:
parent
e337f1ef5e
commit
f78b6df192
@ -151,15 +151,17 @@ typedef struct _mp_obj_fun_bc_t {
|
|||||||
mp_obj_t extra_args[]; // values of default args (if any), plus a slot at the end for var args and/or kw args (if it takes them)
|
mp_obj_t extra_args[]; // values of default args (if any), plus a slot at the end for var args and/or kw args (if it takes them)
|
||||||
} mp_obj_fun_bc_t;
|
} mp_obj_fun_bc_t;
|
||||||
|
|
||||||
void dump_args(const mp_obj_t *a, int sz) {
|
|
||||||
#if DEBUG_PRINT
|
#if DEBUG_PRINT
|
||||||
|
STATIC void dump_args(const mp_obj_t *a, int sz) {
|
||||||
DEBUG_printf("%p: ", a);
|
DEBUG_printf("%p: ", a);
|
||||||
for (int i = 0; i < sz; i++) {
|
for (int i = 0; i < sz; i++) {
|
||||||
DEBUG_printf("%p ", a[i]);
|
DEBUG_printf("%p ", a[i]);
|
||||||
}
|
}
|
||||||
DEBUG_printf("\n");
|
DEBUG_printf("\n");
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define dump_args(...) (void)0
|
||||||
|
#endif
|
||||||
|
|
||||||
// If it's possible to call a function without allocating new argument array,
|
// If it's possible to call a function without allocating new argument array,
|
||||||
// this function returns true, together with pointers to 2 subarrays to be used
|
// this function returns true, together with pointers to 2 subarrays to be used
|
||||||
|
Loading…
x
Reference in New Issue
Block a user