mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 18:15:18 +00:00
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:
parent
19a70c11e4
commit
c9602ce212
@ -495,10 +495,10 @@ void OnFatalError(const char* location, const char* message) {
|
|||||||
ABORT();
|
ABORT();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OOMErrorHandler(const char* location, bool is_heap_oom) {
|
void OOMErrorHandler(const char* location, const v8::OOMDetails& details) {
|
||||||
const char* message =
|
const char* message =
|
||||||
is_heap_oom ? "Allocation failed - JavaScript heap out of memory"
|
details.is_heap_oom ? "Allocation failed - JavaScript heap out of memory"
|
||||||
: "Allocation failed - process out of memory";
|
: "Allocation failed - process out of memory";
|
||||||
if (location) {
|
if (location) {
|
||||||
FPrintF(stderr, "FATAL ERROR: %s %s\n", location, message);
|
FPrintF(stderr, "FATAL ERROR: %s %s\n", location, message);
|
||||||
} else {
|
} else {
|
||||||
|
@ -21,7 +21,7 @@ void AppendExceptionLine(Environment* env,
|
|||||||
|
|
||||||
[[noreturn]] void FatalError(const char* location, const char* message);
|
[[noreturn]] void FatalError(const char* location, const char* message);
|
||||||
void OnFatalError(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
|
// Helpers to construct errors similar to the ones provided by
|
||||||
// lib/internal/errors.js.
|
// lib/internal/errors.js.
|
||||||
|
Loading…
Reference in New Issue
Block a user