Commit 23812633 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

Mark FatalProcessOutOfMemory as noreturn

This method always calls the FATAL macro, which is also marked
[[noreturn]]. The documentation already mentioned this, but now it's
actually enforced by the compiler.

R=adamk@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I2e331c9826fad6aad9c22929a0d5f890a508d0d9
Reviewed-on: https://chromium-review.googlesource.com/966561Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52115}
parent ef00f27e
......@@ -20,7 +20,8 @@ namespace internal {
// Called when allocation routines fail to allocate, even with a possible retry.
// This function should not return, but should terminate the current processing.
V8_EXPORT_PRIVATE void FatalProcessOutOfMemory(const char* message);
[[noreturn]] V8_EXPORT_PRIVATE void FatalProcessOutOfMemory(
const char* message);
// Superclass for classes managed with new & delete.
class V8_EXPORT_PRIVATE Malloced {
......
......@@ -330,7 +330,7 @@ void i::V8::FatalProcessOutOfMemory(const char* location, bool is_heap_oom) {
// Note that the embedder's oom handler won't be called in this case. We
// just crash.
FATAL("API fatal error handler returned after process out of memory");
return;
UNREACHABLE();
}
memset(last_few_messages, 0, Heap::kTraceRingBufferSize + 1);
......
......@@ -23,8 +23,8 @@ class V8 : public AllStatic {
// Report process out of memory. Implementation found in api.cc.
// This function will not return, but will terminate the execution.
static void FatalProcessOutOfMemory(const char* location,
bool is_heap_oom = false);
[[noreturn]] static void FatalProcessOutOfMemory(const char* location,
bool is_heap_oom = false);
static void InitializePlatform(v8::Platform* platform);
static void ShutdownPlatform();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment