summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common
Commit message (Collapse)AuthorAgeFilesLines
...
* Mmap interceptor new option, Write Exec runtime detectorVitaly Buka2018-03-164-0/+35
| | | | | | | | | | | | | | | | Summary: Following-up the refactoring of mmap interceptors, adding a new common option to detect PROT_WRITE|PROT_EXEC pages request. Patch by David CARLIER Reviewers: vitalybuka, vsk Reviewed By: vitalybuka Subscribers: krytarowski, #sanitizers Differential Revision: https://reviews.llvm.org/D44194 llvm-svn: 327696
* OpenBSD UBsan support procmapsVitaly Buka2018-03-154-9/+144
| | | | | | | | | | | | | | | | Summary: procmaps OpenBSD specifics Patch by David CARLIER Reviewers: krytarowski, vitalybuka Reviewed By: vitalybuka Subscribers: mgorny, emaste, kubamracek, fedor.sergeev, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44050 llvm-svn: 327677
* OpenBSD UBsan support common functionsVitaly Buka2018-03-152-69/+107
| | | | | | | | | | | | | | | | Summary: Ripped off OpenBSD specific from the common Linux implementation Patch by David Carlier Reviewers: krytarowski, vitalybuka Reviewed By: vitalybuka Subscribers: emaste, srhines, kubamracek, fedor.sergeev, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44036 llvm-svn: 327674
* [sanitizer] Fix off type in mmap64 interceptorVitaly Buka2018-03-151-1/+1
| | | | llvm-svn: 327596
* [Sanitizers] Add more standard compliant posix_memalign implementation for LSan.Alex Shlyapnikov2018-03-121-6/+2
| | | | | | | | | | | | | | | Summary: Add more standard compliant posix_memalign implementation for LSan and use corresponding sanitizer's posix_memalign implenetations in allocation wrappers on Mac. Reviewers: eugenis, fjricci Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D44335 llvm-svn: 327338
* [sanitizer] Align & pad the allocator structures to the cacheline size v2Kostya Kortchinsky2018-03-124-15/+18
| | | | | | | | | | | | | | | | | | | | Summary: This is a new version of D44261, which broke some builds with older gcc, as they can't align on a constexpr, but rather require an integer (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56859) among others. We introduce `SANITIZER_CACHE_LINE_SIZE` in `sanitizer_platform.h` to be used in `ALIGNED` attributes instead of using directly `kCacheLineSize`. Reviewers: alekseyshl, thakis Reviewed By: alekseyshl Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D44326 llvm-svn: 327297
* [sanitizer] Revert rCRT327145Kostya Kortchinsky2018-03-093-14/+13
| | | | | | | | | | | | | | | | | | | Summary: It breaks the Chromium toolchain due to: ``` lib/sanitizer_common/sanitizer_allocator_primary32.h:269:34: error: requested alignment is not an integer constant struct ALIGNED(kCacheLineSize) SizeClassInfo { ``` Reviewers: alekseyshl, thakis Reviewed By: thakis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D44320 llvm-svn: 327167
* [sanitizer] Align & pad the allocator structures to the cacheline sizeKostya Kortchinsky2018-03-093-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Both `SizeClassInfo` structures for the 32-bit primary & `RegionInfo` structures for the 64-bit primary can be used by different threads, and as such they should be aligned & padded to the cacheline size to avoid false sharing. The former was padded but the array was not aligned, the latter was not padded but we lucked up as the size of the structure was 192 bytes, and aligned by the properties of `mmap`. I plan on adding a couple of fields to the `RegionInfo`, and some highly threaded tests pointed out that without proper padding & alignment, performance was getting a hit - and it is going away with proper padding. This patch makes sure that we are properly padded & aligned for both. I used a template to avoid padding if the size is already a multiple of the cacheline size. There might be a better way to do this, I am open to suggestions. Reviewers: alekseyshl, dvyukov Reviewed By: alekseyshl Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D44261 llvm-svn: 327145
* Build LLVMDemangle from build_symbolizer.shEugene Zemtsov2018-03-081-1/+1
| | | | | | Symbolizer now depends on internal implementation of itaniumDemangle. llvm-svn: 326987
* Add Demangle lib into internalization listEugene Zemtsov2018-03-081-0/+1
| | | | | | Symbolizer now depends on internal implementation of itaniumDemangle. llvm-svn: 326983
* [sanitizer] Fix SANITIZER_INTERCEPT_MMAP and SANITIZER_INTERCEPT_MMAP64 valuesVitaly Buka2018-03-071-2/+2
| | | | llvm-svn: 326938
* Don't intercept mmap64() on NetBSDKamil Rytarowski2018-03-071-1/+1
| | | | | | | | | Disable SANITIZER_INTERCEPT_MMAP64 for SI_NETBSD. NetBSD switched to 64-bit offsets almost 30 years ago on 32-bit platforms and never needed mmap64() concept. llvm-svn: 326883
* Fixup r326851: mmap64 interceptor should not be used on Darwin.Kuba Mracek2018-03-071-1/+1
| | | | llvm-svn: 326864
* [sanitizer] Update symbolizer testVitaly Buka2018-03-071-0/+1
| | | | llvm-svn: 326855
* [sanitizer] Extract common code into STRXFRM_INTERCEPTOR_IMPLVitaly Buka2018-03-071-48/+22
| | | | llvm-svn: 326854
* [sanitizer] Move strxfrm interceptors into sanitizer_commonVitaly Buka2018-03-072-4/+73
| | | | llvm-svn: 326853
* [sanitizer] Add interceptors for wcsxfrm, wcsxfrm_lVitaly Buka2018-03-072-0/+37
| | | | | | | | | | | | | | Patch by Oliver Chang Reviewers: vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44133 llvm-svn: 326852
* [sanitizer] Move mmap interceptors into sanitizer_commonVitaly Buka2018-03-072-0/+39
| | | | | | | | | | Reviewers: devnexen, krytarowski, eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D44125 llvm-svn: 326851
* OpenBSD sanitizer common, define RLIMIT_AS constantKamil Rytarowski2018-03-061-0/+2
| | | | | | | | | | | | | | | | Summary: define RLIMIT_AS constant until it s defined in the future Patch by: David Carlier Reviewers: krytarowski, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44068 llvm-svn: 326768
* [sanitizer] Fix the return type for GetTid in Fuchsia implementationPetr Hosek2018-03-061-1/+1
| | | | | | | | | This is triggering "functions that differ only in their return type cannot be overloaded" error. Differential Revision: https://reviews.llvm.org/D44126 llvm-svn: 326759
* Remove more references to ptrace_pt_{g,s}et_sigmaskKamil Rytarowski2018-03-031-4/+0
| | | | | | | | | | These operations are now obsolete on NetBSD and will be removed. No functional change for other OSes. Sponsored by <The NetBSD Foundation> llvm-svn: 326663
* Fix NetBSD 32-bit buildKamil Rytarowski2018-03-031-1/+1
| | | | | | | | Replace 'defined(SANITIZER_OPENBSD)' with appropriate 'SANITIZER_OPENBSD'. This is a fallout from adding OpenBSD partial support. llvm-svn: 326662
* Remove obsolete ptrace(2) operations from NetBSDKamil Rytarowski2018-03-033-9/+1
| | | | | | | | | PT_SET_SIGMASK and PT_GET_SIGMASK will be removed from NetBSD without backward compat (it shortlived in a development branch). Sponsored by <The NetBSD Foundation> llvm-svn: 326657
* Revert D44035Kamil Rytarowski2018-03-032-111/+67
| | | | | | Broken syntax. llvm-svn: 326655
* Hotfix for D44035Kamil Rytarowski2018-03-031-1/+1
| | | | | | Try to fix the syntax. llvm-svn: 326654
* Support OpenBSD in common interceptorsKamil Rytarowski2018-03-032-67/+111
| | | | | | | | | | | | | | | | | | | | | | | Summary: Extract INIT_PTHREAD_ATTR_GET_SCHED from INIT_PTHREAD_ATTR_GET, as the former is not supported on OpenBSD. Supported interceptors getdetachstate, getguardsize, getscope, getstacksize, getgrouplist and getstack Unsupported getschedparam, getgroupmembership and getschedpolicy Patch by David CARLIER Reviewers: krytarowski, vitalybuka Reviewed By: vitalybuka Subscribers: fedor.sergeev, srhines, kubamracek, mgorny, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44035 llvm-svn: 326653
* OpenBSD UBsan support enabling SANITIZER_OPENBSD widelyKamil Rytarowski2018-03-038-13/+28
| | | | | | | | | | | | | | | | Summary: Adding OpenBSD platform Patch by: David CARLIER Reviewers: krytarowski, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, kubamracek, fedor.sergeev, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44049 llvm-svn: 326651
* OpenBSD UBsan support / commonKamil Rytarowski2018-03-034-0/+762
| | | | | | | | | | | | | | | | | | | Summary: Sanitizer common, enable OpenBSD platform. - Enable common interceptors as possible and create few distinct ones. - Create necessary sanitizer_struct types. Patch by: David CARLIER Reviewers: krytarowski, vitalybuka, visa, kettenis Reviewed By: vitalybuka Subscribers: emaste, srhines, kubamracek, mgorny, fedor.sergeev, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43909 llvm-svn: 326650
* Sanitiser common, using u64 type for GetTid on posix systemsKamil Rytarowski2018-03-032-7/+5
| | | | | | | | | | | | | | | | | Summary: Moving from ptr to u64 for GetTid posix implementation. [FreeBSD] Moving from pthread_self to thr_self more appropriate to get thread ID. Patch by: David CARLIER Reviewers: krytarowski, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43998 llvm-svn: 326647
* Adding Msan support to FreeBSDKamil Rytarowski2018-03-032-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: Enabling the memory sanitizer support for FreeBSD, most of unit tests are compatible. - Adding fstat and stressor_r interceptors. - Updating the struct link_map access since most likely the struct Obj_Entry had been updated since. - Disabling few unit tests until further work is needed (or we can assume it can work in real world code). Patch by: David CARLIER Reviewers: vitalybuka, krytarowski Reviewed By: vitalybuka Subscribers: eugenis, dim, srhines, emaste, kubamracek, mgorny, fedor.sergeev, hintonda, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43080 llvm-svn: 326644
* Add new interceptors: getnetent(3) familyKamil Rytarowski2018-02-273-0/+79
| | | | | | | | | | | | | | | | | | | | | Summary: getnetent, getnetbyaddr, getnetbyname - get network entry Reuse them on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43543 llvm-svn: 326163
* Add new interceptors: getprotoent(3) familyKamil Rytarowski2018-02-273-0/+78
| | | | | | | | | | | | | | | | | | | | | Summary: getprotoent, getprotobynumber, getprotobyname - get protocol entry Reuse them on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43541 llvm-svn: 326162
* Add new interceptors: getttyent(3) familyKamil Rytarowski2018-02-274-0/+51
| | | | | | | | | | | | | | | | | | | | | Summary: getttyent, getttynam, setttyentpath - get ttys file entry Reuse them on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43539 llvm-svn: 326161
* [asan] Be more careful and verbose when allocating dynamic shadow memoryKuba Mracek2018-02-264-8/+12
| | | | | | | | FindAvailableMemoryRange can currently overwrite existing memory (by restricting the VM below addresses that are already used). This patch adds a check to make sure we don't restrict the VM space too much. We are also now more explicit about why the lookup failed and print out verbose values. Differential Revision: https://reviews.llvm.org/D43318 llvm-svn: 326106
* Skip two more ioctl interceptors for NetBSDKamil Rytarowski2018-02-261-3/+1
| | | | | | | | | | | | | | Don't intercept: - HFSC_IF_ATTACH - HFSC_MOD_CLASS These operations conflict on NetBSD 32-bit with: - PRIQ_IF_ATTACH - PRIQ_MOD_CLASS Sponsored by <The NetBSD Foundation> llvm-svn: 326084
* Correct ctype(3) functions with NLS on NetBSDKamil Rytarowski2018-02-241-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The setlocale(3) function reloads the ctype(3) arrays from external files. This happens behind the scenes in the internals of libc (citrus library, runes functions etc). ctype(3) functions like isspace(3) can be provided with two variations on NetBSD: inlined or via a global symbol in libc: ``` #if defined(_NETBSD_SOURCE) && !defined(_CTYPE_NOINLINE) && \ !defined(__cplusplus) #include <sys/ctype_inline.h> #else #include <sys/ctype_bits.h> #endif ``` The in-lined versions are de-facto array lookup operations. ``` #define isspace(c) ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_S)) ``` After setting setlocale(3) the ctype(3) arrays (_ctype_tab_, _toupper_tab_, _tolower_tab_) are reload behind the scenes and they are required to be marked as initialized. Set them initialized inside the common setlocale(3) interceptor. The arrays are of size of 257 elements: 0..255 + 1 (EOF). This corrects errors on NetBSD/amd64 in applications prebuilt with MSan. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, dvyukov, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42020 llvm-svn: 326008
* [Sanitizers] Increase allocated chunk limit for LargeMmapAllocatorAlex Shlyapnikov2018-02-242-11/+64
| | | | | | | | | | | | | | | | | | | | | | | Summary: There are applications out there which allocate more than 1 << 18 large chunks of memory (those handled by LargeMmapAllocator, aka secondary allocator). For 64 bits, secondary allocator stores allocated chunks in a growing on demand region of memory, growing in blocks of 128K, up to 1 << 20 chunks total. Sanitizer internal allocator's secondary uses fixed size array storing up to 1 << 15 chunks (down to 256K from 2Mb of memory used for that array). Nothing is changed for 32 bits, chunks are still stored in the fixed size array (up to 1 << 15 chunks). Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D43693 llvm-svn: 326007
* [sanitizer] Allow to set SANITIZER_CAN_USE_PREINIT_ARRAY externallyVitaly Buka2018-02-211-0/+2
| | | | llvm-svn: 325720
* [hwasan] Fix inline instrumentation.Evgeniy Stepanov2018-02-214-0/+7
| | | | | | | | | | | | | | | This patch changes hwasan inline instrumentation: Fixes address untagging for shadow address calculation (use 0xFF instead of 0x00 for the top byte). Emits brk instruction instead of hlt for the kernel and user space. Use 0x900 instead of 0x100 for brk immediate (0x100 - 0x800 are unavailable in the kernel). Fixes and adds appropriate tests. Patch by Andrey Konovalov. Differential Revision: https://reviews.llvm.org/D43135 llvm-svn: 325711
* Msan, fixing DTLS_on_tls_get_addr signature empty implementationKamil Rytarowski2018-02-211-1/+2
| | | | | | | | | | | | | | | | Summary: No supported oses normally compiled that code (or not for a long time) probably never caught it. Patch by: David CARLIER Reviewers: vitalybuka, krytarowski Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43502 llvm-svn: 325664
* Add new interceptor: strmode(3)Kamil Rytarowski2018-02-202-0/+15
| | | | | | | | | | | | | | | | | | | Summary: strmode - convert inode status information into a symbolic string Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43485 llvm-svn: 325588
* Add new interceptor: fgetln(3)Kamil Rytarowski2018-02-202-0/+18
| | | | | | | | | | | | | | | | | | | Summary: fgetln - get a line from a stream Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43482 llvm-svn: 325587
* Recognize all NetBSD architectures in UBSanKamil Rytarowski2018-02-171-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Use uniform accessors for Program Pointer, Stack Pointer and Frame Pointer. Remove CPU check in UBSan supported platforms and rely only on the OS type. This adds NetBSD support in GetPcSpBp() for: - ARM - ARM64 - HPPA - PowerPC/PowerPC64 - SPARC/SPARC64 - MIPS - DEC Alpha AXP - DEC VAX - M68K and M68010 - SH3 - IA64 - OR1K - RISCV Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, ro Reviewed By: vitalybuka Subscribers: aemerson, jyknight, sdardis, kubamracek, arichardson, llvm-commits, kristof.beyls, fedor.sergeev, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43021 llvm-svn: 325431
* Implement a large part of NetBSD syscalls of netbsd_syscall_hooks.hKamil Rytarowski2018-02-151-1/+3688
| | | | | | | | | | This is a follow up of: r325206 - Add NetBSD syscall hooks skeleton in sanitizers Sponsored by <The NetBSD Foundation> llvm-svn: 325248
* Add Xray instrumentation support to FreeBSDKamil Rytarowski2018-02-151-1/+2
| | | | | | | | | | | | | | | | | | | Summary: - Enabling the build. - Using assembly for the cpuid parts. - Using thr_self FreeBSD call to get the thread id Patch by: David CARLIER Reviewers: dberris, rnk, krytarowski Reviewed By: dberris, krytarowski Subscribers: emaste, stevecheckoway, nglevin, srhines, kubamracek, dberris, mgorny, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43278 llvm-svn: 325240
* Teach sanitizer about NetBSD specific ioctl(2) callsKamil Rytarowski2018-02-156-205/+5169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Introduce handling of 1200 NetBSD specific ioctl(2) calls. Over 100 operations are disabled as unavailable or conflicting with the existing ones (the same operation number). Add a script that generates the rules to detect ioctls on NetBSD. The generate_netbsd_ioctls.awk script has been written in NetBSD awk(1) (patched nawk) and is compatible with gawk. Generate lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc with the awk(1) script. Update sanitizer_platform_limits_netbsd accordingly to add the needed definitions. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis, dvyukov Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, mgorny, fedor.sergeev, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41636 llvm-svn: 325212
* Add NetBSD syscall hooks skeleton in sanitizersKamil Rytarowski2018-02-152-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Implement the skeleton of NetBSD syscall hooks for use with sanitizers. Add a script that generates the rules to handle syscalls on NetBSD: generate_netbsd_syscalls.awk. It has been written in NetBSD awk(1) (patched nawk) and is compatible with gawk. Generate lib/sanitizer_common/sanitizer_platform_limits_netbsd.h that is a public header for applications, and included as: <sanitizer_common/sanitizer_platform_limits_netbsd.h>. Generate sanitizer_syscalls_netbsd.inc that defines all the syscall rules for NetBSD. This file is modeled after the Linux specific file: sanitizer_common_syscalls.inc. Start recognizing NetBSD syscalls with existing sanitizers: ASan, ESan, HWASan, TSan, MSan. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, dvyukov, eugenis Reviewed By: vitalybuka Subscribers: hintonda, kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42048 llvm-svn: 325206
* Add new interceptor: lstat(2)Kamil Rytarowski2018-02-152-0/+19
| | | | | | | | | | | | | | | | | | | | | Summary: lstat - get file status Use it on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42909 llvm-svn: 325199
* [sanitizer] Implement GetRSS on WindowsKostya Kortchinsky2018-02-131-1/+4
| | | | | | | | | | | | | | | | | | Summary: Pretty straightforward, returning the `WorkingSetSize` of a `PROCESS_MEMORY_COUNTERS` structure. AFAIU, `GetProcessMemoryInfo` is in `kernel32.lib` for Windows 7 and above. Support for earlier Windows versions would require `psapi.lib`, but I don't think those are supported by ASan? Reviewers: alekseyshl, rnk, vitalybuka Reviewed By: vitalybuka Subscribers: vitalybuka, kubamracek, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D42822 llvm-svn: 325020
* [sanitizer] Size class map & local cache improvementsKostya Kortchinsky2018-02-123-40/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - Reland rL324263, this time allowing for a compile-time decision as to whether or not use the 32-bit division. A single test is using a class map covering a maximum size greater than 4GB, this can be checked via the template parameters, and allows SizeClassAllocator64PopulateFreeListOOM to pass; - `MaxCachedHint` is always called on a class id for which we have already computed the size, but we still recompute `Size(class_id)`. Change the prototype of the function to work on sizes instead of class ids. This also allows us to get rid of the `kBatchClassID` special case. Update the callers accordingly; - `InitCache` and `Drain` will start iterating at index 1: index 0 contents are unused and can safely be left to be 0. Plus we do not pay the cost of going through an `UNLIKELY` in `MaxCachedHint`, and touching memory that is otherwise not used; - `const` some variables in the areas modified; - Remove an spurious extra line at the end of a file. Reviewers: alekseyshl, tl0gic, dberris Reviewed By: alekseyshl, dberris Subscribers: dberris, kubamracek, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43088 llvm-svn: 324906
OpenPOWER on IntegriCloud