This question is similar to one I recently asked about LLVM.
V8 allocates JavaScript objects on a manually-managed heap, memory for which is ultimately obtained from mmap/VirtualAlloc (on Linux/Windows). However, for its internal data structures, V8 uses C++ standard containers such as std::vector
. If these containers need to allocate memory, but are unable to, they usually throw std::bad_alloc
.
However, V8 is compiled with -fno-exceptions. If exceptions cannot be used, how does V8 handle the situation where the internal data structures are unable to allocate memory? Does it crash? If so, does this take down any process which embeds V8?