From c9602ce2120de78fc0393f6a82cb00955834bba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 20 Aug 2022 10:17:48 +0200 Subject: [PATCH] src: use new v8::OOMErrorCallback API PR-URL: https://github.com/nodejs/node/pull/44741 Reviewed-By: Ben Noordhuis Reviewed-By: Jiawen Geng Reviewed-By: James M Snell --- src/node_errors.cc | 6 +++--- src/node_errors.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node_errors.cc b/src/node_errors.cc index 45419f2c61fd79..c400d74d23bbbd 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -495,10 +495,10 @@ void OnFatalError(const char* location, const char* message) { ABORT(); } -void OOMErrorHandler(const char* location, bool is_heap_oom) { +void OOMErrorHandler(const char* location, const v8::OOMDetails& details) { const char* message = - is_heap_oom ? "Allocation failed - JavaScript heap out of memory" - : "Allocation failed - process out of memory"; + details.is_heap_oom ? "Allocation failed - JavaScript heap out of memory" + : "Allocation failed - process out of memory"; if (location) { FPrintF(stderr, "FATAL ERROR: %s %s\n", location, message); } else { diff --git a/src/node_errors.h b/src/node_errors.h index 5cc385c743e0b3..68a95835812e50 100644 --- a/src/node_errors.h +++ b/src/node_errors.h @@ -21,7 +21,7 @@ void AppendExceptionLine(Environment* env, [[noreturn]] void FatalError(const char* location, const char* message); void OnFatalError(const char* location, const char* message); -void OOMErrorHandler(const char* location, bool is_heap_oom); +void OOMErrorHandler(const char* location, const v8::OOMDetails& details); // Helpers to construct errors similar to the ones provided by // lib/internal/errors.js.