diff options
author | Damien George <damien@micropython.org> | 2024-03-25 13:10:12 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-03-28 16:18:09 +1100 |
commit | d2276f0d41c2fa66a224725fdb2411846c91cf1a (patch) | |
tree | e3f25bf47b4e8adfd5fd341819fded5457d961e4 /py/nativeglue.c | |
parent | 4662a71f44bd8a0f8ff96d12e43f69be3bff8488 (diff) |
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>
Diffstat (limited to 'py/nativeglue.c')
-rw-r--r-- | py/nativeglue.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/py/nativeglue.c b/py/nativeglue.c index 4cd090c0a..ba3d93f76 100644 --- a/py/nativeglue.c +++ b/py/nativeglue.c @@ -29,6 +29,7 @@ #include <string.h> #include <assert.h> +#include "py/binary.h" #include "py/runtime.h" #include "py/smallint.h" #include "py/nativeglue.h" @@ -330,6 +331,9 @@ const mp_fun_table_t mp_fun_table = { mp_obj_get_float_to_d, mp_get_buffer, mp_get_stream_raise, + mp_binary_get_size, + mp_binary_get_val_array, + mp_binary_set_val_array, &mp_plat_print, &mp_type_type, &mp_type_str, |