Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl3/gcc/dist/libsanitizer Reduce sizes for non _LP...
details: https://anonhg.NetBSD.org/src/rev/9763e84e1784
branches: trunk
changeset: 362833:9763e84e1784
user: christos <christos%NetBSD.org@localhost>
date: Wed Jun 27 15:57:20 2018 +0000
description:
Reduce sizes for non _LP64 and compiler checks so that the code compiles
(but it will not work, since there is not enough address space to implement
the shadow space required).
diffstat:
external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc | 10 ++++++++++
external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h | 2 ++
2 files changed, 12 insertions(+), 0 deletions(-)
diffs (46 lines):
diff -r acf94b032aee -r 9763e84e1784 external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc
--- a/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc Wed Jun 27 15:56:30 2018 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc Wed Jun 27 15:57:20 2018 +0000
@@ -26,7 +26,11 @@
struct ChunkMetadata {
u8 allocated : 8; // Must be first.
ChunkTag tag : 2;
+#ifdef _LP64
uptr requested_size : 54;
+#else
+ uptr requested_size : 30;
+#endif
u32 stack_trace_id;
};
@@ -40,9 +44,15 @@
sizeof(ChunkMetadata), SizeClassMap, kRegionSizeLog, ByteMap>
PrimaryAllocator;
#else
+#if _LP64
static const uptr kMaxAllowedMallocSize = 8UL << 30;
static const uptr kAllocatorSpace = 0x600000000000ULL;
static const uptr kAllocatorSize = 0x40000000000ULL; // 4T.
+#else
+static const uptr kMaxAllowedMallocSize = 8UL << 20;
+static const uptr kAllocatorSpace = 0x60000000UL;
+static const uptr kAllocatorSize = 0x40000000ULL; // 2G.
+#endif
typedef SizeClassAllocator64<kAllocatorSpace, kAllocatorSize,
sizeof(ChunkMetadata), DefaultSizeClassMap> PrimaryAllocator;
#endif
diff -r acf94b032aee -r 9763e84e1784 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h Wed Jun 27 15:56:30 2018 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h Wed Jun 27 15:57:20 2018 +0000
@@ -475,9 +475,11 @@
private:
static const uptr kRegionSize = kSpaceSize / kNumClassesRounded;
static const uptr kSpaceEnd = kSpaceBeg + kSpaceSize;
+#if _LP64
COMPILER_CHECK(kSpaceBeg % kSpaceSize == 0);
// kRegionSize must be >= 2^32.
COMPILER_CHECK((kRegionSize) >= (1ULL << (SANITIZER_WORDSIZE / 2)));
+#endif
// Populate the free list with at most this number of bytes at once
// or with one element if its size is greater.
static const uptr kPopulateSize = 1 << 14;
Home |
Main Index |
Thread Index |
Old Index