frameArena.allocF64¶
Summary¶
frameArena.allocF64 reserves contiguous float64 storage for temporary WebAssembly work. Use it for pointer-based APIs that expect doubles, such as the precision-specific math helpers. The allocation lasts until the next frame-arena reset.
Syntax¶
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
len |
number |
Yes | Number of f64 elements to reserve. Pass a positive integer. |
Returns¶
number - Byte pointer to the first element in Wasm memory. A failed allocation throws. The arena resets at the beginning of each wgpu.run frame. Standalone render and render warmup also reset it when the loop is stopped.
Example¶
const ptr = wgpu.frameArena.allocF64(3);
const values = wgpu.driver.view(Float64Array, ptr, 3);
values.set([1, 2, 3]);
// Consume the pointer before the next arena reset.
Notes¶
Use wgpu.driver.frame.allocF64(len) for an epoch-checked typed slice, or a heap allocation for storage that needs to survive across frames.