summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/xray/xray_allocator.h
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2018-07-19 05:08:59 +0000
committerDavid Carlier <devnexen@gmail.com>2018-07-19 05:08:59 +0000
commitcfc1d1d46e75aa2888ba031be2e7c8267f016587 (patch)
treec59a5c554d261e88e6007030b1b441bca5c39248 /compiler-rt/lib/xray/xray_allocator.h
parentd855928ec37e26e98813046d2eb8062ab18cc40c (diff)
downloadbcm5719-llvm-cfc1d1d46e75aa2888ba031be2e7c8267f016587.tar.gz
bcm5719-llvm-cfc1d1d46e75aa2888ba031be2e7c8267f016587.zip
[Xray] Fix allocator build, MAP_NORESERVE flag is not always supported
MAP_NORESERVE is not supported or a no-op on BSD. Reviewers: dberris Reviewed By: dberris Differential Revision: https://reviews.llvm.org/D49494 llvm-svn: 337440
Diffstat (limited to 'compiler-rt/lib/xray/xray_allocator.h')
-rw-r--r--compiler-rt/lib/xray/xray_allocator.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler-rt/lib/xray/xray_allocator.h b/compiler-rt/lib/xray/xray_allocator.h
index 5d0a62547e4..8244815284a 100644
--- a/compiler-rt/lib/xray/xray_allocator.h
+++ b/compiler-rt/lib/xray/xray_allocator.h
@@ -20,11 +20,16 @@
#include "sanitizer_common/sanitizer_internal_defs.h"
#include "sanitizer_common/sanitizer_mutex.h"
#include "sanitizer_common/sanitizer_posix.h"
-#include "sys/mman.h"
#include "xray_utils.h"
+#include <sys/mman.h>
#include <cstddef>
#include <cstdint>
+#ifndef MAP_NORESERVE
+// no-op on NetBSD (at least), unsupported flag on FreeBSD basically because unneeded
+#define MAP_NORESERVE 0
+#endif
+
namespace __xray {
/// The Allocator type hands out fixed-sized chunks of memory that are
OpenPOWER on IntegriCloud