Fix ALIGNED misuse in asan_thread.cc (built on all platforms); also, add a comment to the ALIGNED macro describing the correct usage

llvm-svn: 183214
This commit is contained in:
Timur Iskhodzhanov 2013-06-04 08:25:17 +00:00
parent 5239d58c8e
commit baf90ccfac
2 changed files with 3 additions and 1 deletions

View File

@ -40,7 +40,7 @@ void AsanThreadContext::OnFinished() {
}
// MIPS requires aligned address
static char thread_registry_placeholder[sizeof(ThreadRegistry)] ALIGNED(16);
static ALIGNED(16) char thread_registry_placeholder[sizeof(ThreadRegistry)];
static ThreadRegistry *asan_thread_registry;
static ThreadContextBase *GetAsanThreadContext(u32 tid) {

View File

@ -132,6 +132,8 @@ using namespace __sanitizer; // NOLINT
#else // _MSC_VER
# define ALWAYS_INLINE inline __attribute__((always_inline))
# define ALIAS(x) __attribute__((alias(x)))
// Please only use the ALIGNED macro before the type.
// Using ALIGNED after the variable declaration is not portable!
# define ALIGNED(x) __attribute__((aligned(x)))
# define FORMAT(f, a) __attribute__((format(printf, f, a)))
# define NOINLINE __attribute__((noinline))