Kostya Serebryany
58560a05ad
[sanitizer] fix an allocator bug where the allocated memory may overlap with the free array (kudos to Kostya Korcthinsky). Also make sure that the allocator does not mmap more than requested. Test both.
...
llvm-svn: 281103
2016-09-09 21:42:33 +00:00
Kostya Serebryany
6496de48c7
[scudo] use 32 bits of ASLR entropy instead of just 24 when shuffling allocated chunks
...
llvm-svn: 279983
2016-08-29 17:45:43 +00:00
Kostya Serebryany
b72479b84a
[asan] first attempt at releasing free-d memory back to the system using madvise. Requires quite some tuning.
...
llvm-svn: 279887
2016-08-26 23:58:42 +00:00
Kostya Serebryany
7c5ae7cbc6
[sanitizer] enable random shuffling the memory chunks inside the allocator, under a flag. Set this flag for the scudo allocator, add a test.
...
llvm-svn: 279793
2016-08-26 00:06:03 +00:00
Kostya Serebryany
15647b17f3
[sanitizer] change SizeClassAllocator64 to accept just one template parameter instead of 5. First, this will make the mangled names shorter. Second, this will make adding more parameters simpler.
...
llvm-svn: 279771
2016-08-25 20:23:08 +00:00
Kostya Serebryany
8e7ea9ddb5
[sanitizer] re-apply r279572 and r279595 reverted in r279643: change the 64-bit allocator to use a single array for free-d chunks instead of a lock-free linked list of tranfer batches. This change simplifies the code, makes the allocator more 'hardened', and will allow simpler code to release RAM to OS. This may also slowdown malloc stress tests due to lock contension, but I did not observe noticeable slowdown on various real multi-threaded benchmarks.
...
llvm-svn: 279664
2016-08-24 21:20:10 +00:00
Vitaly Buka
769ec705bc
Revert r279572 "[sanitizer] change the 64-bit..." because of failures on ubsan
...
This reverts commit r279572 and r279595.
llvm-svn: 279643
2016-08-24 17:40:29 +00:00
Kostya Serebryany
865a98d2ed
[sanitizer] trying to fix the PPC bots
...
llvm-svn: 279595
2016-08-24 00:10:25 +00:00
Kostya Serebryany
f46d50e360
[sanitizer] change the 64-bit allocator to use a single array for free-d chunks instead of a lock-free linked list of tranfer batches. This change simplifies the code, makes the allocator more 'hardened', and will allow simpler code to release RAM to OS. This may also slowdown malloc stress tests due to lock contension, but I did not observe noticeable slowdown on various real multi-threaded benchmarks.
...
llvm-svn: 279572
2016-08-23 21:19:47 +00:00
Kostya Serebryany
ce2163459f
[sanitizer] allocator: split the local cache class into two, one for 32-bit allocator and one for 64-bit one. NFC. The two imlementations will diverge in the following changes.
...
llvm-svn: 279495
2016-08-23 00:30:43 +00:00
Kostya Serebryany
1ab649649d
[sanitizer] use 32-bit offset instead of 64-bit pointers in the 64-bit allocator's transfer batches. This saves 2x memory for the transfer batches (up to ~1.5% overall in some cases)
...
llvm-svn: 278179
2016-08-09 23:30:22 +00:00
Kostya Serebryany
d4a5749677
[sanitizer] minor refactoring in the allocator, NFC
...
llvm-svn: 278163
2016-08-09 20:54:50 +00:00
Kostya Serebryany
4cd2845e6a
[sanitizer] allocator: move TransferBatch into SizeClassAllocator64/SizeClassAllocator32 because we actually need different iplementations for the 64- and 32-bit case. NFC; the following patches will make the TransferBatch implementations differ
...
llvm-svn: 277899
2016-08-06 01:24:11 +00:00
Etienne Bergeron
d2b37ada4d
fix whitespaces from https://reviews.llvm.org/D23170
...
llvm-svn: 277746
2016-08-04 18:30:41 +00:00
Etienne Bergeron
27eb6d521e
[compiler-rt] Fix memory allocator for dynamic address space
...
Summary:
The sanitizer allocators can works with a dynamic address space
(i.e. specified with ~0ULL).
Unfortunately, the code was broken on GetMetadata and GetChunkIdx.
The current patch is moving the Win64 memory test to a dynamic
address space. There is a migration to move every concept to a
dynamic address space on windows.
To have a better coverage, the unittest are now testing
dynamic address space on other platforms too.
Reviewers: rnk, kcc
Subscribers: kubabrecka, dberris, llvm-commits, chrisha
Differential Revision: https://reviews.llvm.org/D23170
llvm-svn: 277745
2016-08-04 18:15:38 +00:00
Kostya Serebryany
c49e296805
[sanitizer] refactor TransferBatch to hide the implementation. NFC expected. Second attempt after failed r276383 which was reverted.
...
llvm-svn: 277554
2016-08-03 00:14:10 +00:00
Kostya Serebryany
d251e94a01
[sanitizer] revert r276383 while investigating failures on bot
...
llvm-svn: 276456
2016-07-22 19:02:59 +00:00
Kostya Serebryany
5bc01c108d
[sanitizer] refactor TransferBatch to hide the implementation. NFC
...
llvm-svn: 276383
2016-07-22 02:21:12 +00:00
Kostya Serebryany
395386f910
[sanitizer] better allocator stats (with rss)
...
llvm-svn: 276343
2016-07-21 21:38:40 +00:00
Kostya Serebryany
35eeea707e
[sanitizer] allocator: remove kPopulateSize and only use SizeClassMap::MaxCached; ensure that TransferBatch size is a power of two, refactor TransferBatch creation/destruction into separate functions.
...
llvm-svn: 276318
2016-07-21 18:47:53 +00:00
Kostya Serebryany
9835a81529
[sanitizers] split sanitizer_allocator.h into a number of smaller .h files; NFC
...
llvm-svn: 276195
2016-07-20 22:06:41 +00:00