MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / callWithMemoryView

Function callWithMemoryView

test/embind/embind_test.cpp:1637–1645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1635}
1636
1637static void callWithMemoryView(val v) {
1638 // static so the JS test can read the memory after callTakeMemoryView runs
1639 static unsigned char data[] = {0, 1, 2, 3, 4, 5, 6, 7};
1640 v(typed_memory_view(getElementCount(data), data));
1641 static float f[] = {1.5f, 2.5f, 3.5f, 4.5f};
1642 v(typed_memory_view(getElementCount(f), f));
1643 static short s[] = {1000, 100, 10, 1};
1644 v(typed_memory_view(getElementCount(s), s));
1645}
1646
1647EMSCRIPTEN_BINDINGS(memory_view_tests) {
1648 function("callWithMemoryView", &callWithMemoryView);

Callers

nothing calls this directly

Calls 3

typed_memory_viewFunction · 0.85
getElementCountFunction · 0.85
vFunction · 0.50

Tested by

no test coverage detected