Add runtime detection of V8 memory cage #3384

When using the V8 memory cage, Buffers cannot be wrapped and then
later freed via a callback. When the cage is detected via a throw,
instead fall back to copying Buffer contents to V8 memory.

This approach will be used by Electron 21+ and you should expect
reduced performance and increased memory consumption/fragmentation.
This commit is contained in:
Lovell Fuller
2022-12-14 16:06:04 +00:00
parent a7fa7014ef
commit 584807b4f5
5 changed files with 19 additions and 7 deletions

View File

@@ -9,6 +9,9 @@ Requires libvips v8.13.3
* Add experimental support for JPEG-XL images. Requires libvips compiled with libjxl.
[#2731](https://github.com/lovell/sharp/issues/2731)
* Add runtime detection of V8 memory cage, ensures compatibility with Electron 21 onwards.
[#3384](https://github.com/lovell/sharp/issues/3384)
* Expose `interFrameMaxError` and `interPaletteMaxError` GIF optimisation properties.
[#3401](https://github.com/lovell/sharp/issues/3401)