Commit 1b94fcac authored by David Carlier's avatar David Carlier Committed by Commit Bot

Small fixes for OS::SignalCodeMovingGC on OpenBSD

This patch stores the result of sysconf() in a long integer and
checks the result of Free().

Change-Id: If77e46a2f188e6bc36ef2e98eac36bf7a7d67dff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1855942Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64263}
parent da34e54e
......@@ -107,7 +107,7 @@ void OS::SignalCodeMovingGC() {
// it. This injects a GC marker into the stream of events generated
// by the kernel and allows us to synchronize V8 code log and the
// kernel log.
int size = sysconf(_SC_PAGESIZE);
long size = sysconf(_SC_PAGESIZE); // NOLINT: type more fit than uint64_t
FILE* f = fopen(OS::GetGCFakeMMapFile(), "w+");
if (f == nullptr) {
OS::PrintError("Failed to open %s\n", OS::GetGCFakeMMapFile());
......@@ -116,7 +116,7 @@ void OS::SignalCodeMovingGC() {
void* addr =
mmap(NULL, size, PROT_READ | PROT_EXEC, MAP_PRIVATE, fileno(f), 0);
DCHECK(addr != MAP_FAILED);
OS::Free(addr, size);
CHECK(OS::Free(addr, size));
fclose(f);
}
......
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