diff options
author | 2022-09-09 03:12:03 -0700 | |
---|---|---|
committer | 2022-09-09 03:12:03 -0700 | |
commit | e9c456ff5cf53d6f57a619db27ed0335c61041eb (patch) | |
tree | 000ae2b52bd6de43ea9657ab91d02f669f19aad8 /src/bun.js/bindings/ZigGeneratedCode.cpp | |
parent | bcbe1b410a32cbed72d671ca28e937e14dad3499 (diff) | |
download | bun-e9c456ff5cf53d6f57a619db27ed0335c61041eb.tar.gz bun-e9c456ff5cf53d6f57a619db27ed0335c61041eb.tar.zst bun-e9c456ff5cf53d6f57a619db27ed0335c61041eb.zip |
[breaking][bun:ffi] Change the pointer representation to be a 52-bit integer
Storing the pointer this way enables DOMJIT to be used with a new API in `bun:ffi` that lets you efficiently read values from a pointer without creating a new `DataView`
```js
import {read} from 'bun:ffi';
const myPtr = myFunctionThatReturnsAPtr();
// new:
const value = read.u32(myPtr, 0);
// old:
const view = new DataView(toArrayBuffer(myPtr));
const otherValue = view.getUint32(0, true);
```
cc @bwasti this might be a breaking change for that call to `napi_add_finalizer`
Diffstat (limited to 'src/bun.js/bindings/ZigGeneratedCode.cpp')
0 files changed, 0 insertions, 0 deletions