diff options
author | Damien George <damien.p.george@gmail.com> | 2015-01-11 22:27:30 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-01-11 22:27:30 +0000 |
commit | 95836f8439b9f1ca0b6ff20f56a03253aa9ba836 (patch) | |
tree | c9fa6b9d1c2aab8d9db9cf1884176a7b4b67c3d5 /py/qstrdefs.h | |
parent | 6942f80a8feb521ff4dc2b457fa5cb3d039bee54 (diff) | |
download | micropython-95836f8439b9f1ca0b6ff20f56a03253aa9ba836.tar.gz micropython-95836f8439b9f1ca0b6ff20f56a03253aa9ba836.zip |
py: Add MICROPY_QSTR_BYTES_IN_LEN config option, defaulting to 1.
This new config option sets how many fixed-number-of-bytes to use to
store the length of each qstr. Previously this was hard coded to 2,
but, as per issue #1056, this is considered overkill since no-one
needs identifiers longer than 255 bytes.
With this patch the number of bytes for the length is configurable, and
defaults to 1 byte. The configuration option filters through to the
makeqstrdata.py script.
Code size savings going from 2 to 1 byte:
- unix x64 down by 592 bytes
- stmhal down by 1148 bytes
- bare-arm down by 284 bytes
Also has RAM savings, and will be slightly more efficient in execution.
Diffstat (limited to 'py/qstrdefs.h')
-rw-r--r-- | py/qstrdefs.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/qstrdefs.h b/py/qstrdefs.h index 514116b65d..71a523c2d6 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -30,7 +30,7 @@ // That is, they are in ROM and you can reference them simply as MP_QSTR_xxxx. // qstr configuration passed to makeqstrdata.py of the form QCFG(key, value) -//QCFG(somekey, somevalue) +QCFG(BYTES_IN_LEN, MICROPY_QSTR_BYTES_IN_LEN) Q() Q(*) |