mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 11:40:18 +01:00
py/qstr: Add qstr_from_strn_static() helper function.
Allows an interned string to reference static/ROM data, instead of allocating it on the GC heap. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -101,6 +101,9 @@ qstr qstr_find_strn(const char *str, size_t str_len); // returns MP_QSTRnull if
|
||||
|
||||
qstr qstr_from_str(const char *str);
|
||||
qstr qstr_from_strn(const char *str, size_t len);
|
||||
#if MICROPY_VFS_ROM
|
||||
qstr qstr_from_strn_static(const char *str, size_t len);
|
||||
#endif
|
||||
|
||||
mp_uint_t qstr_hash(qstr q);
|
||||
const char *qstr_str(qstr q);
|
||||
|
||||
Reference in New Issue
Block a user