Commit 6993943e authored by mic.besace's avatar mic.besace Committed by Commit bot

FreeBSD: Fix semaphore alignment

On FreeBSD, sem_t is a struct with a couple of uint32_t fields. It only
needs dword alignment on 64 bits architectures, not the qword (pointer)
alignment that the CHECK currently enforces.

BUG=

Review-Url: https://codereview.chromium.org/2268993002
Cr-Commit-Position: refs/heads/master@{#38829}
parent 287a7152
......@@ -77,8 +77,8 @@ Semaphore::Semaphore(int count) {
// Unaligned native handle can later cause a failure in semaphore signal.
// Check the alignment here to catch the failure earlier.
// Context: crbug.com/605349.
#if V8_OS_AIX
// On aix sem_t is of type int
#if V8_OS_AIX || V8_OS_FREEBSD
// On aix sem_t is of type int. On FreeBSD, it's a struct of 32 bits fields.
const uintptr_t kSemaphoreAlignmentMask = sizeof(int) - 1;
#else
const uintptr_t kSemaphoreAlignmentMask = sizeof(void*) - 1;
......
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