src: use new v8::OOMErrorCallback API

PR-URL: https://github.com/nodejs/node/pull/44741
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Michaël Zasso 2022-08-20 10:17:48 +02:00
parent 19a70c11e4
commit c9602ce212
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600
2 changed files with 4 additions and 4 deletions

View File

@ -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 {

View File

@ -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.