X-Git-Url: https://git.lttng.org/?p=ust.git;a=blobdiff_plain;f=include%2Fust%2Fcore.h;h=eee405dd4c27a46d743eecb625daaed5c144f065;hp=d0e2750f1fab74253c9f2bcd2c843ccf7943241c;hb=9edd34bd25f52dd39b354a84f02697254121aefd;hpb=13ef5c0efe5894668297bfa10f1304c40866c054 diff --git a/include/ust/core.h b/include/ust/core.h index d0e2750..eee405d 100644 --- a/include/ust/core.h +++ b/include/ust/core.h @@ -24,42 +24,6 @@ #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) -#ifndef HAVE_EFFICIENT_UNALIGNED_ACCESS - -/* - * Calculate the offset needed to align the type. - * size_of_type must be non-zero. - */ -static inline unsigned int ltt_align(size_t align_drift, size_t size_of_type) -{ - size_t alignment = min(sizeof(void *), size_of_type); - return (alignment - align_drift) & (alignment - 1); -} -/* Default arch alignment */ -#define LTT_ALIGN - -static inline int ltt_get_alignment(void) -{ - return sizeof(void *); -} - -#else /* HAVE_EFFICIENT_UNALIGNED_ACCESS */ - -static inline unsigned int ltt_align(size_t align_drift, - size_t size_of_type) -{ - return 0; -} - -#define LTT_ALIGN __attribute__((packed)) - -static inline int ltt_get_alignment(void) -{ - return 0; -} -#endif /* HAVE_EFFICIENT_UNALIGNED_ACCESS */ - - /* ARRAYS */ #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))