Commit 142488db authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[heap] Move DCHECK from constructor to NewMessageBuilder

The DCHECK is only guaranteed to hold after checking that is_logging()
still returns true.

Bug: v8:10315
Change-Id: Ia43657faffa4c7eda70c95a446bee1389d08e6fd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2418713Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70013}
parent 066b5ac9
......@@ -79,6 +79,7 @@ std::unique_ptr<Log::MessageBuilder> Log::NewMessageBuilder() {
// fine if a background thread starts logging a bit later, but we want to
// avoid background threads continue logging after logging was already closed.
if (!logger_->is_logging()) return {};
DCHECK_NOT_NULL(format_buffer_.get());
return result;
}
......@@ -98,7 +99,6 @@ std::string Log::file_name() const { return file_name_; }
Log::MessageBuilder::MessageBuilder(Log* log)
: log_(log), lock_guard_(&log_->mutex_) {
DCHECK_NOT_NULL(log_->format_buffer_.get());
}
void Log::MessageBuilder::AppendString(String str,
......
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