Module Name: src Committed By: christos Date: Wed Jun 27 15:57:20 UTC 2018
Modified Files: src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.cc src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_allocator.h Log Message: 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). To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.2 \ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc cvs rdiff -u -r1.1.1.3 -r1.2 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc:1.1.1.2 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc:1.1.1.2 Thu Feb 1 20:58:47 2018 +++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc Wed Jun 27 11:57:20 2018 @@ -26,7 +26,11 @@ namespace __lsan { 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 @@ typedef SizeClassAllocator32<0, SANITIZE 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 Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h:1.1.1.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h:1.2 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h:1.1.1.3 Thu Feb 1 20:58:46 2018 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h Wed Jun 27 11:57:20 2018 @@ -475,9 +475,11 @@ class SizeClassAllocator64 { 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;