Search code examples
c++v8embedded-v8

Embedder side pointer compression is DISABLED


I have built v8 8.4 for Windows as a monolithic static lib, and am trying to get this sample project running using Visual Studio 2019.

The error I get when the project runs is this:

# Fatal error in ../../src/api/api.cc, line 5619
# Embedder-vs-V8 build configuration mismatch. On embedder side pointer compression is DISABLED while on V8 side it's ENABLED.

I have tried rebuilding v8 with v8_enable_pointer_compression set to false, but v8 doesn't build. I would rather it be enabled though if possible.


Solution

  • To turn on pointer compression, compile your app with the compiler flags V8_COMPRESS_POINTERS and V8_31BIT_SMIS_ON_64BIT_ARCH defined (e.g. set to 1).

    (With GCC/Clang, you'd add -DV8_COMPRESS_POINTERS to the command line; I don't know what the Visual Studio equivalent is, probably there's some build settings configuration thingie.)