diff options
author | Damien George <damien.p.george@gmail.com> | 2015-03-29 14:05:46 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-04-03 14:11:13 +0100 |
commit | 567184e21e9a6a37fd71153a43874dec7a3f5e0c (patch) | |
tree | 3b496ed01feecad15f3661d8b0b01d8dc71141cd /py/mpconfig.h | |
parent | 12a5e17afb6a59d1eb0e1ce0444d7e4891f6391b (diff) | |
download | micropython-567184e21e9a6a37fd71153a43874dec7a3f5e0c.tar.gz micropython-567184e21e9a6a37fd71153a43874dec7a3f5e0c.zip |
py: Allow configurable object representation, with 2 different options.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r-- | py/mpconfig.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index d561f80790..27ec5dd3ef 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -49,6 +49,25 @@ // 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 */ // Number of words allocated (in BSS) to the GC stack (minimum is 1) |