Skip to content

Commit c9602ce

Browse files
committed
src: use new v8::OOMErrorCallback API
PR-URL: #44741 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 19a70c1 commit c9602ce

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/node_errors.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,10 @@ void OnFatalError(const char* location, const char* message) {
495495
ABORT();
496496
}
497497

498-
void OOMErrorHandler(const char* location, bool is_heap_oom) {
498+
void OOMErrorHandler(const char* location, const v8::OOMDetails& details) {
499499
const char* message =
500-
is_heap_oom ? "Allocation failed - JavaScript heap out of memory"
501-
: "Allocation failed - process out of memory";
500+
details.is_heap_oom ? "Allocation failed - JavaScript heap out of memory"
501+
: "Allocation failed - process out of memory";
502502
if (location) {
503503
FPrintF(stderr, "FATAL ERROR: %s %s\n", location, message);
504504
} else {

src/node_errors.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void AppendExceptionLine(Environment* env,
2121

2222
[[noreturn]] void FatalError(const char* location, const char* message);
2323
void OnFatalError(const char* location, const char* message);
24-
void OOMErrorHandler(const char* location, bool is_heap_oom);
24+
void OOMErrorHandler(const char* location, const v8::OOMDetails& details);
2525

2626
// Helpers to construct errors similar to the ones provided by
2727
// lib/internal/errors.js.

0 commit comments

Comments
 (0)