diff options
Diffstat (limited to 'linker/linker_allocator.h')
-rw-r--r-- | linker/linker_allocator.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/linker/linker_allocator.h b/linker/linker_allocator.h index 80ae5080c..9c16828ef 100644 --- a/linker/linker_allocator.h +++ b/linker/linker_allocator.h @@ -88,12 +88,12 @@ class linker_vector_allocator { T* allocate(size_t n, const T* hint = nullptr) { size_t size = n * sizeof(T); - void* ptr = mmap(const_cast<T*>(hint), size, - PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0); + void* ptr = mmap(const_cast<T*>(hint), size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, + -1, 0); if (ptr == MAP_FAILED) { // Spec says we need to throw std::bad_alloc here but because our // code does not support exception handling anyways - we are going to abort. - async_safe_fatal("mmap failed"); + async_safe_fatal("mmap failed: %s", strerror(errno)); } prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, ptr, size, "linker_alloc_vector"); |