diff options
Diffstat (limited to 'absl/base')
-rw-r--r-- | absl/base/attributes.h | 10 | ||||
-rw-r--r-- | absl/base/internal/malloc_hook.cc | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/absl/base/attributes.h b/absl/base/attributes.h index 4e1fc8b550d1..c44b2e893258 100644 --- a/absl/base/attributes.h +++ b/absl/base/attributes.h @@ -527,6 +527,16 @@ #define ABSL_ATTRIBUTE_PACKED #endif +// ABSL_ATTRIBUTE_FUNC_ALIGN +// +// Tells the compiler to align the function start at least to certain +// alignment boundary +#if ABSL_HAVE_ATTRIBUTE(aligned) || (defined(__GNUC__) && !defined(__clang__)) +#define ABSL_ATTRIBUTE_FUNC_ALIGN(bytes) __attribute__((aligned(bytes))) +#else +#define ABSL_ATTRIBUTE_FUNC_ALIGN(bytes) +#endif + // ABSL_CONST_INIT // // A variable declaration annotated with the `ABSL_CONST_INIT` attribute will diff --git a/absl/base/internal/malloc_hook.cc b/absl/base/internal/malloc_hook.cc index 780e8fe3296c..e7b626df125b 100644 --- a/absl/base/internal/malloc_hook.cc +++ b/absl/base/internal/malloc_hook.cc @@ -437,6 +437,7 @@ static inline bool InHookCaller(const void* caller) { return ADDR_IN_ATTRIBUTE_SECTION(caller, google_malloc) || ADDR_IN_ATTRIBUTE_SECTION(caller, malloc_hook) || ADDR_IN_ATTRIBUTE_SECTION(caller, blink_malloc); + // We can use one section for everything except tcmalloc_or_debug // due to its special linkage mode, which prevents merging of the sections. } |