From 567184e21e9a6a37fd71153a43874dec7a3f5e0c Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 29 Mar 2015 14:05:46 +0100 Subject: py: Allow configurable object representation, with 2 different options. --- py/mpconfig.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'py/mpconfig.h') diff --git a/py/mpconfig.h b/py/mpconfig.h index d561f8079..27ec5dd3e 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -48,6 +48,25 @@ // Any options not explicitly set in mpconfigport.h will get default // values below. +/*****************************************************************************/ +/* Object representation */ + +// A Micro Python object is a machine word having the following form: +// - xxxx...xxx1 : a small int, bits 1 and above are the value +// - xxxx...xx10 : a qstr, bits 2 and above are the value +// - xxxx...xx00 : a pointer to an mp_obj_base_t (unless a fake object) +#define MICROPY_OBJ_REPR_A (0) + +// A Micro Python object is a machine word having the following form: +// - xxxx...xx01 : a small int, bits 2 and above are the value +// - xxxx...xx11 : a qstr, bits 2 and above are the value +// - xxxx...xxx0 : a pointer to an mp_obj_base_t (unless a fake object) +#define MICROPY_OBJ_REPR_B (1) + +#ifndef MICROPY_OBJ_REPR +#define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_A) +#endif + /*****************************************************************************/ /* Memory allocation policy */ -- cgit v1.2.3