Skip to content

Commit da8510c

Browse files
committed
__sanitizer_cdecl -> SANITIZER_CDECL
1 parent a124d88 commit da8510c

13 files changed

+284
-284
lines changed

compiler-rt/include/sanitizer/allocator_interface.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,54 +21,54 @@ extern "C" {
2121
for request of "size" bytes. If allocator can't allocate that much
2222
memory, returns the maximal possible allocation size, otherwise returns
2323
"size". */
24-
size_t __sanitizer_cdecl __sanitizer_get_estimated_allocated_size(size_t size);
24+
size_t SANITIZER_CDECL __sanitizer_get_estimated_allocated_size(size_t size);
2525

2626
/* Returns true if p was returned by the allocator and
2727
is not yet freed. */
28-
int __sanitizer_cdecl __sanitizer_get_ownership(const volatile void *p);
28+
int SANITIZER_CDECL __sanitizer_get_ownership(const volatile void *p);
2929

3030
/* If a pointer lies within an allocation, it will return the start address
3131
of the allocation. Otherwise, it returns nullptr. */
32-
const void *__sanitizer_cdecl __sanitizer_get_allocated_begin(const void *p);
32+
const void *SANITIZER_CDECL __sanitizer_get_allocated_begin(const void *p);
3333

3434
/* Returns the number of bytes reserved for the pointer p.
3535
Requires (get_ownership(p) == true) or (p == 0). */
36-
size_t __sanitizer_cdecl __sanitizer_get_allocated_size(const volatile void *p);
36+
size_t SANITIZER_CDECL __sanitizer_get_allocated_size(const volatile void *p);
3737

3838
/* Returns the number of bytes reserved for the pointer p.
3939
Requires __sanitizer_get_allocated_begin(p) == p. */
40-
size_t __sanitizer_cdecl
40+
size_t SANITIZER_CDECL
4141
__sanitizer_get_allocated_size_fast(const volatile void *p);
4242

4343
/* Number of bytes, allocated and not yet freed by the application. */
44-
size_t __sanitizer_cdecl __sanitizer_get_current_allocated_bytes(void);
44+
size_t SANITIZER_CDECL __sanitizer_get_current_allocated_bytes(void);
4545

4646
/* Number of bytes, mmaped by the allocator to fulfill allocation requests.
4747
Generally, for request of X bytes, allocator can reserve and add to free
4848
lists a large number of chunks of size X to use them for future requests.
4949
All these chunks count toward the heap size. Currently, allocator never
5050
releases memory to OS (instead, it just puts freed chunks to free
5151
lists). */
52-
size_t __sanitizer_cdecl __sanitizer_get_heap_size(void);
52+
size_t SANITIZER_CDECL __sanitizer_get_heap_size(void);
5353

5454
/* Number of bytes, mmaped by the allocator, which can be used to fulfill
5555
allocation requests. When a user program frees memory chunk, it can first
5656
fall into quarantine and will count toward __sanitizer_get_free_bytes()
5757
later. */
58-
size_t __sanitizer_cdecl __sanitizer_get_free_bytes(void);
58+
size_t SANITIZER_CDECL __sanitizer_get_free_bytes(void);
5959

6060
/* Number of bytes in unmapped pages, that are released to OS. Currently,
6161
always returns 0. */
62-
size_t __sanitizer_cdecl __sanitizer_get_unmapped_bytes(void);
62+
size_t SANITIZER_CDECL __sanitizer_get_unmapped_bytes(void);
6363

6464
/* Malloc hooks that may be optionally provided by user.
6565
__sanitizer_malloc_hook(ptr, size) is called immediately after
6666
allocation of "size" bytes, which returned "ptr".
6767
__sanitizer_free_hook(ptr) is called immediately before
6868
deallocation of "ptr". */
69-
void __sanitizer_cdecl __sanitizer_malloc_hook(const volatile void *ptr,
69+
void SANITIZER_CDECL __sanitizer_malloc_hook(const volatile void *ptr,
7070
size_t size);
71-
void __sanitizer_cdecl __sanitizer_free_hook(const volatile void *ptr);
71+
void SANITIZER_CDECL __sanitizer_free_hook(const volatile void *ptr);
7272

7373
/* Installs a pair of hooks for malloc/free.
7474
Several (currently, 5) hook pairs may be installed, they are executed
@@ -82,16 +82,16 @@ void __sanitizer_cdecl __sanitizer_free_hook(const volatile void *ptr);
8282
Not thread-safe, should be called in the main thread before starting
8383
other threads.
8484
*/
85-
int __sanitizer_cdecl __sanitizer_install_malloc_and_free_hooks(
86-
void (*__sanitizer_cdecl malloc_hook)(const volatile void *, size_t),
87-
void (*__sanitizer_cdecl free_hook)(const volatile void *));
85+
int SANITIZER_CDECL __sanitizer_install_malloc_and_free_hooks(
86+
void (*SANITIZER_CDECL malloc_hook)(const volatile void *, size_t),
87+
void (*SANITIZER_CDECL free_hook)(const volatile void *));
8888

8989
/* Drains allocator quarantines (calling thread's and global ones), returns
9090
freed memory back to OS and releases other non-essential internal allocator
9191
resources in attempt to reduce process RSS.
9292
Currently available with ASan only.
9393
*/
94-
void __sanitizer_cdecl __sanitizer_purge_allocator(void);
94+
void SANITIZER_CDECL __sanitizer_purge_allocator(void);
9595
#ifdef __cplusplus
9696
} // extern "C"
9797
#endif

compiler-rt/include/sanitizer/asan_interface.h

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extern "C" {
3131
///
3232
/// \param addr Start of memory region.
3333
/// \param size Size of memory region.
34-
void __sanitizer_cdecl __asan_poison_memory_region(void const volatile *addr,
34+
void SANITIZER_CDECL __asan_poison_memory_region(void const volatile *addr,
3535
size_t size);
3636

3737
/// Marks a memory region (<c>[addr, addr+size)</c>) as addressable.
@@ -46,7 +46,7 @@ void __sanitizer_cdecl __asan_poison_memory_region(void const volatile *addr,
4646
///
4747
/// \param addr Start of memory region.
4848
/// \param size Size of memory region.
49-
void __sanitizer_cdecl __asan_unpoison_memory_region(void const volatile *addr,
49+
void SANITIZER_CDECL __asan_unpoison_memory_region(void const volatile *addr,
5050
size_t size);
5151

5252
// Macros provided for convenience.
@@ -85,7 +85,7 @@ void __sanitizer_cdecl __asan_unpoison_memory_region(void const volatile *addr,
8585
///
8686
/// \retval 1 Address is poisoned.
8787
/// \retval 0 Address is not poisoned.
88-
int __sanitizer_cdecl __asan_address_is_poisoned(void const volatile *addr);
88+
int SANITIZER_CDECL __asan_address_is_poisoned(void const volatile *addr);
8989

9090
/// Checks if a region is poisoned.
9191
///
@@ -95,14 +95,14 @@ int __sanitizer_cdecl __asan_address_is_poisoned(void const volatile *addr);
9595
/// \param beg Start of memory region.
9696
/// \param size Start of memory region.
9797
/// \returns Address of first poisoned byte.
98-
void *__sanitizer_cdecl __asan_region_is_poisoned(void *beg, size_t size);
98+
void *SANITIZER_CDECL __asan_region_is_poisoned(void *beg, size_t size);
9999

100100
/// Describes an address (useful for calling from the debugger).
101101
///
102102
/// Prints the description of <c><i>addr</i></c>.
103103
///
104104
/// \param addr Address to describe.
105-
void __sanitizer_cdecl __asan_describe_address(void *addr);
105+
void SANITIZER_CDECL __asan_describe_address(void *addr);
106106

107107
/// Checks if an error has been or is being reported (useful for calling from
108108
/// the debugger to get information about an ASan error).
@@ -111,7 +111,7 @@ void __sanitizer_cdecl __asan_describe_address(void *addr);
111111
///
112112
/// \returns 1 if an error has been (or is being) reported. Otherwise returns
113113
/// 0.
114-
int __sanitizer_cdecl __asan_report_present(void);
114+
int SANITIZER_CDECL __asan_report_present(void);
115115

116116
/// Gets the PC (program counter) register value of an ASan error (useful for
117117
/// calling from the debugger).
@@ -120,7 +120,7 @@ int __sanitizer_cdecl __asan_report_present(void);
120120
/// Otherwise returns 0.
121121
///
122122
/// \returns PC value.
123-
void *__sanitizer_cdecl __asan_get_report_pc(void);
123+
void *SANITIZER_CDECL __asan_get_report_pc(void);
124124

125125
/// Gets the BP (base pointer) register value of an ASan error (useful for
126126
/// calling from the debugger).
@@ -129,7 +129,7 @@ void *__sanitizer_cdecl __asan_get_report_pc(void);
129129
/// Otherwise returns 0.
130130
///
131131
/// \returns BP value.
132-
void *__sanitizer_cdecl __asan_get_report_bp(void);
132+
void *SANITIZER_CDECL __asan_get_report_bp(void);
133133

134134
/// Gets the SP (stack pointer) register value of an ASan error (useful for
135135
/// calling from the debugger).
@@ -138,7 +138,7 @@ void *__sanitizer_cdecl __asan_get_report_bp(void);
138138
/// Otherwise returns 0.
139139
///
140140
/// \returns SP value.
141-
void *__sanitizer_cdecl __asan_get_report_sp(void);
141+
void *SANITIZER_CDECL __asan_get_report_sp(void);
142142

143143
/// Gets the address of the report buffer of an ASan error (useful for calling
144144
/// from the debugger).
@@ -147,31 +147,31 @@ void *__sanitizer_cdecl __asan_get_report_sp(void);
147147
/// reported. Otherwise returns 0.
148148
///
149149
/// \returns Address of report buffer.
150-
void *__sanitizer_cdecl __asan_get_report_address(void);
150+
void *SANITIZER_CDECL __asan_get_report_address(void);
151151

152152
/// Gets access type of an ASan error (useful for calling from the debugger).
153153
///
154154
/// Returns access type (read or write) if an error has been (or is being)
155155
/// reported. Otherwise returns 0.
156156
///
157157
/// \returns Access type (0 = read, 1 = write).
158-
int __sanitizer_cdecl __asan_get_report_access_type(void);
158+
int SANITIZER_CDECL __asan_get_report_access_type(void);
159159

160160
/// Gets access size of an ASan error (useful for calling from the debugger).
161161
///
162162
/// Returns access size if an error has been (or is being) reported. Otherwise
163163
/// returns 0.
164164
///
165165
/// \returns Access size in bytes.
166-
size_t __sanitizer_cdecl __asan_get_report_access_size(void);
166+
size_t SANITIZER_CDECL __asan_get_report_access_size(void);
167167

168168
/// Gets the bug description of an ASan error (useful for calling from a
169169
/// debugger).
170170
///
171171
/// \returns Returns a bug description if an error has been (or is being)
172172
/// reported - for example, "heap-use-after-free". Otherwise returns an empty
173173
/// string.
174-
const char *__sanitizer_cdecl __asan_get_report_description(void);
174+
const char *SANITIZER_CDECL __asan_get_report_description(void);
175175

176176
/// Gets information about a pointer (useful for calling from the debugger).
177177
///
@@ -192,7 +192,7 @@ const char *__sanitizer_cdecl __asan_get_report_description(void);
192192
/// \param[out] region_size Size of the region in bytes.
193193
///
194194
/// \returns Returns the category of the given pointer as a constant string.
195-
const char *__sanitizer_cdecl __asan_locate_address(void *addr, char *name,
195+
const char *SANITIZER_CDECL __asan_locate_address(void *addr, char *name,
196196
size_t name_size,
197197
void **region_address,
198198
size_t *region_size);
@@ -209,7 +209,7 @@ const char *__sanitizer_cdecl __asan_locate_address(void *addr, char *name,
209209
/// \param[out] thread_id The thread ID of the address.
210210
///
211211
/// \returns Returns the number of stored frames or 0 on error.
212-
size_t __sanitizer_cdecl __asan_get_alloc_stack(void *addr, void **trace,
212+
size_t SANITIZER_CDECL __asan_get_alloc_stack(void *addr, void **trace,
213213
size_t size, int *thread_id);
214214

215215
/// Gets the free stack trace and thread ID for a heap address (useful for
@@ -224,15 +224,15 @@ size_t __sanitizer_cdecl __asan_get_alloc_stack(void *addr, void **trace,
224224
/// \param[out] thread_id The thread ID of the address.
225225
///
226226
/// \returns Returns the number of stored frames or 0 on error.
227-
size_t __sanitizer_cdecl __asan_get_free_stack(void *addr, void **trace,
227+
size_t SANITIZER_CDECL __asan_get_free_stack(void *addr, void **trace,
228228
size_t size, int *thread_id);
229229

230230
/// Gets the current shadow memory mapping (useful for calling from the
231231
/// debugger).
232232
///
233233
/// \param[out] shadow_scale Shadow scale value.
234234
/// \param[out] shadow_offset Offset value.
235-
void __sanitizer_cdecl __asan_get_shadow_mapping(size_t *shadow_scale,
235+
void SANITIZER_CDECL __asan_get_shadow_mapping(size_t *shadow_scale,
236236
size_t *shadow_offset);
237237

238238
/// This is an internal function that is called to report an error. However,
@@ -245,31 +245,31 @@ void __sanitizer_cdecl __asan_get_shadow_mapping(size_t *shadow_scale,
245245
/// \param addr Address of the ASan error.
246246
/// \param is_write True if the error is a write error; false otherwise.
247247
/// \param access_size Size of the memory access of the ASan error.
248-
void __sanitizer_cdecl __asan_report_error(void *pc, void *bp, void *sp,
248+
void SANITIZER_CDECL __asan_report_error(void *pc, void *bp, void *sp,
249249
void *addr, int is_write,
250250
size_t access_size);
251251

252252
// Deprecated. Call __sanitizer_set_death_callback instead.
253-
void __sanitizer_cdecl __asan_set_death_callback(void (*callback)(void));
253+
void SANITIZER_CDECL __asan_set_death_callback(void (*callback)(void));
254254

255255
/// Sets the callback function to be called during ASan error reporting.
256256
///
257257
/// The callback provides a string pointer to the report.
258258
///
259259
/// \param callback User-provided function.
260-
void __sanitizer_cdecl
260+
void SANITIZER_CDECL
261261
__asan_set_error_report_callback(void (*callback)(const char *));
262262

263263
/// User-provided callback on ASan errors.
264264
///
265265
/// You can provide a function that would be called immediately when ASan
266266
/// detects an error. This is useful in cases when ASan detects an error but
267267
/// your program crashes before the ASan report is printed.
268-
void __sanitizer_cdecl __asan_on_error(void);
268+
void SANITIZER_CDECL __asan_on_error(void);
269269

270270
/// Prints accumulated statistics to <c>stderr</c> (useful for calling from the
271271
/// debugger).
272-
void __sanitizer_cdecl __asan_print_accumulated_stats(void);
272+
void SANITIZER_CDECL __asan_print_accumulated_stats(void);
273273

274274
/// User-provided default option settings.
275275
///
@@ -278,7 +278,7 @@ void __sanitizer_cdecl __asan_print_accumulated_stats(void);
278278
/// <c>verbosity=1:halt_on_error=0</c>).
279279
///
280280
/// \returns Default options string.
281-
const char *__sanitizer_cdecl __asan_default_options(void);
281+
const char *SANITIZER_CDECL __asan_default_options(void);
282282

283283
// The following two functions facilitate garbage collection in presence of
284284
// ASan's fake stack.
@@ -290,7 +290,7 @@ const char *__sanitizer_cdecl __asan_default_options(void);
290290
/// does not have a fake stack.
291291
///
292292
/// \returns An opaque handler to the fake stack or NULL.
293-
void *__sanitizer_cdecl __asan_get_current_fake_stack(void);
293+
void *SANITIZER_CDECL __asan_get_current_fake_stack(void);
294294

295295
/// Checks if an address belongs to a given fake stack.
296296
///
@@ -310,7 +310,7 @@ void *__sanitizer_cdecl __asan_get_current_fake_stack(void);
310310
/// \param[out] beg Beginning of fake frame.
311311
/// \param[out] end End of fake frame.
312312
/// \returns Stack address or NULL.
313-
void *__sanitizer_cdecl __asan_addr_is_in_fake_stack(void *fake_stack,
313+
void *SANITIZER_CDECL __asan_addr_is_in_fake_stack(void *fake_stack,
314314
void *addr, void **beg,
315315
void **end);
316316

@@ -319,11 +319,11 @@ void *__sanitizer_cdecl __asan_addr_is_in_fake_stack(void *fake_stack,
319319
///
320320
/// To avoid false positives on the stack, must be called before no-return
321321
/// functions like <c>_exit()</c> and <c>execl()</c>.
322-
void __sanitizer_cdecl __asan_handle_no_return(void);
322+
void SANITIZER_CDECL __asan_handle_no_return(void);
323323

324324
/// Update allocation stack trace for the given allocation to the current stack
325325
/// trace. Returns 1 if successful, 0 if not.
326-
int __sanitizer_cdecl __asan_update_allocation_context(void *addr);
326+
int SANITIZER_CDECL __asan_update_allocation_context(void *addr);
327327

328328
#ifdef __cplusplus
329329
} // extern "C"

0 commit comments

Comments
 (0)