Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: third_party/WebKit/Source/wtf/ContainerAnnotations.h

Issue 1611343002: wtf reformat test Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pydent Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WTF_ContainerAnnotations_h 5 #ifndef WTF_ContainerAnnotations_h
6 #define WTF_ContainerAnnotations_h 6 #define WTF_ContainerAnnotations_h
7 7
8 #include "wtf/AddressSanitizer.h" 8 #include "wtf/AddressSanitizer.h"
9 #include "wtf/CPU.h" 9 #include "wtf/CPU.h"
10 10
11 // TODO(ochang): Remove the CPU(X86_64) condition to enable this for X86 once 11 // TODO(ochang): Remove the CPU(X86_64) condition to enable this for X86 once
12 // the crashes there have been fixed: http://crbug.com/461406 12 // the crashes there have been fixed: http://crbug.com/461406
13 #if defined(ADDRESS_SANITIZER) && OS(LINUX) && CPU(X86_64) 13 #if defined(ADDRESS_SANITIZER) && OS(LINUX) && CPU(X86_64)
14 #define ANNOTATE_CONTIGUOUS_CONTAINER 14 #define ANNOTATE_CONTIGUOUS_CONTAINER
15 #define ANNOTATE_NEW_BUFFER(buffer, capacity, newSize) \ 15 #define ANNOTATE_NEW_BUFFER(buffer, capacity, newSize) \
16 if (buffer) { \ 16 if (buffer) { \
17 __sanitizer_annotate_contiguous_container(buffer, (buffer) + (capacity), (buffer) + (capacity), (buffer) + (newSize)); \ 17 __sanitizer_annotate_contiguous_container(buffer, (buffer) + (capacity), \
18 } 18 (buffer) + (capacity), \
19 #define ANNOTATE_DELETE_BUFFER(buffer, capacity, oldSize) \ 19 (buffer) + (newSize)); \
20 if (buffer) { \ 20 }
21 __sanitizer_annotate_contiguous_container(buffer, (buffer) + (capacity), (buffer) + (oldSize), (buffer) + (capacity)); \ 21 #define ANNOTATE_DELETE_BUFFER(buffer, capacity, oldSize) \
22 } 22 if (buffer) { \
23 #define ANNOTATE_CHANGE_SIZE(buffer, capacity, oldSize, newSize) \ 23 __sanitizer_annotate_contiguous_container(buffer, (buffer) + (capacity), \
24 if (buffer) { \ 24 (buffer) + (oldSize), \
25 __sanitizer_annotate_contiguous_container(buffer, (buffer) + (capacity), (buffer) + (oldSize), (buffer) + (newSize)); \ 25 (buffer) + (capacity)); \
26 } 26 }
27 #define ANNOTATE_CHANGE_SIZE(buffer, capacity, oldSize, newSize) \
28 if (buffer) { \
29 __sanitizer_annotate_contiguous_container(buffer, (buffer) + (capacity), \
30 (buffer) + (oldSize), \
31 (buffer) + (newSize)); \
32 }
27 #define ANNOTATE_CHANGE_CAPACITY(buffer, oldCapacity, bufferSize, newCapacity) \ 33 #define ANNOTATE_CHANGE_CAPACITY(buffer, oldCapacity, bufferSize, newCapacity) \
28 ANNOTATE_DELETE_BUFFER(buffer, oldCapacity, bufferSize); \ 34 ANNOTATE_DELETE_BUFFER(buffer, oldCapacity, bufferSize); \
29 ANNOTATE_NEW_BUFFER(buffer, newCapacity, bufferSize); 35 ANNOTATE_NEW_BUFFER(buffer, newCapacity, bufferSize);
30 // Annotations require buffers to begin on an 8-byte boundary. 36 // Annotations require buffers to begin on an 8-byte boundary.
31 #else // defined(ADDRESS_SANITIZER) && OS(LINUX) && CPU(X86_64) 37 #else // defined(ADDRESS_SANITIZER) && OS(LINUX) && CPU(X86_64)
32 #define ANNOTATE_NEW_BUFFER(buffer, capacity, newSize) 38 #define ANNOTATE_NEW_BUFFER(buffer, capacity, newSize)
33 #define ANNOTATE_DELETE_BUFFER(buffer, capacity, oldSize) 39 #define ANNOTATE_DELETE_BUFFER(buffer, capacity, oldSize)
34 #define ANNOTATE_CHANGE_SIZE(buffer, capacity, oldSize, newSize) 40 #define ANNOTATE_CHANGE_SIZE(buffer, capacity, oldSize, newSize)
35 #define ANNOTATE_CHANGE_CAPACITY(buffer, oldCapacity, bufferSize, newCapacity) 41 #define ANNOTATE_CHANGE_CAPACITY(buffer, oldCapacity, bufferSize, newCapacity)
36 #endif // defined(ADDRESS_SANITIZER) && OS(LINUX) && CPU(X86_64) 42 #endif // defined(ADDRESS_SANITIZER) && OS(LINUX) && CPU(X86_64)
37 43
38 #endif // WTF_ContainerAnnotations_h 44 #endif // WTF_ContainerAnnotations_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/ConditionalDestructor.h ('k') | third_party/WebKit/Source/wtf/CryptographicallyRandomNumber.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698