You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allocates a new array in the module's memory and returns a reference (pointer) to it.
55
-
Automatically retains interior pointers. The `id` is the unique runtime id of the respective array class. If you are using `Int32Array` for example, the best way to know the id is an `export const INT32ARRAY_ID = idof<Int32Array>()`. When done with the array, make sure to release it.
56
-
57
-
```ts
58
-
var ptr =module.__retain(module.__allocArray(module.INT32ARRAY, [1, 2, 3]));
Gets a view on the values of an array in the module's memory. This differs from `__getArray` in that the data isn't copied but remains *live* in both directions. That's faster but also unsafe because if the array grows or becomes released, the view will no longer represent the correct memory region and modifying its values in this state will most likely corrupt memory. Use, but use with care.
73
-
74
-
If the type of the array is known beforehand, the following even faster and even more unsafe helpers can be used that don't do any type checking:
64
+
If the type of the array is known beforehand, the following slightly faster helpers that don't infer the type can be used:
Gets a live view on the values of an array in the module's memory. Infers the array type from RTTI.
80
+
81
+
This differs from `__getArray` in that the data isn't copied but remains *live* in both directions. That's faster but also unsafe because if the array grows or becomes released, the view will no longer represent the correct memory region and modifying its values in this state will most likely corrupt memory. Use, but use with care.
82
+
83
+
If the type of the array is known beforehand, the following slightly faster helpers that don't infer the type can be used:
Allocates a new array in the module's memory and returns a reference (pointer) to it.
118
+
Automatically retains interior pointers. The `id` is the unique runtime id of the respective array class. If you are using `Int32Array` for example, the best way to know the id is an `export const INT32ARRAY_ID = idof<Int32Array>()`. When done with the array, make sure to release it.
119
+
120
+
```ts
121
+
var ptr =module.__retain(module.__allocArray(module.INT32ARRAY, [1, 2, 3]));
0 commit comments