++#ifdef __OpenBSD__ ++ // OpenBSD kills the process if the stack pointer points into memory not ++ // mapped with MAP_STACK. That flag can only be set at mmap() time, so remap ++ // the region in place. The pages are freshly mapped and untouched, so ++ // discarding their contents here is fine. ++ void* result = MozTaggedAnonymousMmap( ++ region, length, int(PageAccess::ReadWrite), ++ MAP_PRIVATE | MAP_ANON | MAP_FIXED | MAP_STACK, -1, 0, "js-gc-stack"); ++ if (result != region) { ++ UnmapPages(region, length); ++ return nullptr; ++ } ++
No comments:
Post a Comment