emscripten-core / emscripten-core/emscripten
The optimized way for passing multidimensional numeric arrays from/to cpp
Open
embind
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
Hi,
I have a general question for passing multidimensional arrays to and from c++ code. Imagine we have the following array.
```
[[[long,long],[long,long],[long,long],[long,long],[long,long],[long,long]],[[long,long],[long,long],[long,long],[long,long],[long,long],[long,long]]]
```
What is the best approach to pass them between js and cpp? I can define a `vector>` object, but I need to define its js class each time, and I feel it can be memory-consuming for large arrays. Is there any better ways to manage numeric multi-dimensional arrays using `val` helper functions?
Contributor guide
Assessment
This issue has not been assessed yet.