py/dynruntime: Add mp_binary_get_size/get_val_array/set_val_array.

These are needed to read/write array.array objects, which is useful in
native code to provide fast extensions that work with big arrays of data.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2024-03-25 13:10:12 +11:00
parent 4662a71f44
commit d2276f0d41
4 changed files with 16 additions and 1 deletions

View File

@@ -52,6 +52,7 @@ MP_SCOPE_FLAG_VIPERRELOC = 0x10
MP_SCOPE_FLAG_VIPERRODATA = 0x20
MP_SCOPE_FLAG_VIPERBSS = 0x40
MP_SMALL_INT_BITS = 31
MP_FUN_TABLE_MP_TYPE_TYPE_OFFSET = 70
# ELF constants
R_386_32 = 1
@@ -754,7 +755,7 @@ def link_objects(env, native_qstr_vals_len):
# Resolve unknown symbols
mp_fun_table_sec = Section(".external.mp_fun_table", b"", 0)
fun_table = {
key: 67 + idx
key: MP_FUN_TABLE_MP_TYPE_TYPE_OFFSET + idx
for idx, key in enumerate(
[
"mp_type_type",