Fix egregious race/infinite loop bug for FreeBSD and NetBSD
The allocator has a loop trying to map an aligned page, and there's an obvious (and commented-on) race condition in it. The purpose is apparently to get an aligned allocation using mmap(). For FreeBSD and NetBSD, we can simply pass the desired alignment to mmap() and we're good. Other platforms are still hosed though. This generally didn't happen, but something about FreeBSD 14.2 on a many core (16+HT) system causes it to park in the loop and stay there, adding new threads to to fun as it goes along. This uses MAP_ALLOCED() if defined avoid the loop completely. We'll see if it works soon enough.
3rdp/build/js-map-aligned.patch
0 → 100644
Please register or sign in to comment