bun-memory 1.1.22 → 1.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,6 +97,8 @@ cs2.i32Array(0x12345678n, new Int32Array([1, 2, 3, 4]));
|
|
|
97
97
|
|
|
98
98
|
## Example: Using Scratches (Recommended)
|
|
99
99
|
|
|
100
|
+
Scratches let you reuse buffers and typed arrays for repeated memory operations, avoiding unnecessary allocations and maximizing performance. This is the most efficient way to read or write large or frequent data.
|
|
101
|
+
|
|
100
102
|
```ts
|
|
101
103
|
const buffer = Buffer.allocUnsafe(256);
|
|
102
104
|
const array = new Uint64Array(buffer.buffer, buffer.byteOffset, buffer.byteLength / 8);
|