Skip to content

Commit

Permalink
Fixup attributes on interface.h
Browse files Browse the repository at this point in the history
Avoided using the general definitions here as this will be included elsewhere, to avoid pollution.
  • Loading branch information
rgal committed Jan 21, 2021
1 parent b53d104 commit 9b01f6f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions compiler-rt/lib/scudo/standalone/include/scudo/interface.h
Expand Up @@ -13,13 +13,24 @@
#include <stdint.h>

extern "C" {
#if defined(_WIN32)
#define SCUDO_WINDOWS 1
#else
#define SCUDO_WINDOWS 0
#endif

#if SCUDO_WINDOWS
#define WEAK
#else
#define WEAK __attribute__((weak))
#endif

__attribute__((weak)) const char *__scudo_default_options();
WEAK const char *__scudo_default_options();

// Post-allocation & pre-deallocation hooks.
// They must be thread-safe and not use heap related functions.
__attribute__((weak)) void __scudo_allocate_hook(void *ptr, size_t size);
__attribute__((weak)) void __scudo_deallocate_hook(void *ptr);
WEAK void __scudo_allocate_hook(void *ptr, size_t size);
WEAK void __scudo_deallocate_hook(void *ptr);

void __scudo_print_stats(void);

Expand Down

0 comments on commit 9b01f6f

Please sign in to comment.