mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
### What does this PR do? Update FFI documentation with a note on Windows API handle values, as pointer encoding to double causes intermittent failures with some classes of handles. Putting it in this accordion feels less than ideal but it's also a very specific use case. The specific issue I experienced: HDCs and HBITMAPs are basically 32 bits, although they are typedef'd in the headers to HANDLE. They are returned from and passed to the GDI APIs as sign-extended versions of the underlying 32-bit value, and so when going through the ptr <-> double pathway of bun FFI, the bottom 11 bits of those values are lost if the original value had bit 31 set, and subsequent calls will fail. Probably this is fixable by correctly encoding 'negative' pointers in the double representation, and I might tackle that if I find time.
Bun Documentation
Official documentation for Bun: the fast, all-in-one JavaScript runtime.
Development
Install the Mintlify CLI to preview the documentation locally:
bun install -g mint
Run the development server:
mint dev
The site will be available at http://localhost:3000.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.