about summary refs log tree commit diff
path: root/absl/base
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2018-02-16T09·13-0800
committerMark Barolak <mbar@google.com>2018-02-16T15·50-0500
commite2d17845973714cda3e828c16131f245dd82b2b6 (patch)
tree0636df21c6f8aed316f8d1b49ea699f6484cb09a /absl/base
parent055cc7dce10aa6bd7cc2ef64e0fe453fb792da62 (diff)
Changes imported from Abseil "staging" branch:
  - db6fa2aed56380c6708670659c6f8603284fcc4a Rework Abseil cmake/README.md by Abseil Team <absl-team@google.com>
  - 192c7d3553bc0fe98f6935ccecff48ed785d89f0 Add function attribute ABSL_ATTRIBUTE_FUNC_ALIGN(bytes) t... by Abseil Team <absl-team@google.com>
  - 1a93e95c71c656add346a0c1771bec26417347ad Internal change by Abseil Team <absl-team@google.com>
  - 5c6d3e023a8749a5cc89f4cc6b57b6684a28b1c1 Internal change by Shaindel Schwartz <shaindel@google.com>
  - e415990ea54cf882646b0bc0a75a6e3c6741ce5f Fix testing of UTF8 characters on Windows (https://github... by Abseil Team <absl-team@google.com>

GitOrigin-RevId: db6fa2aed56380c6708670659c6f8603284fcc4a
Change-Id: I128a7ca751fa207ef272809c1b908568d187c87e
Diffstat (limited to 'absl/base')
-rw-r--r--absl/base/attributes.h10
-rw-r--r--absl/base/internal/malloc_hook.cc1
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.
 }