6 #ifndef ABTU_H_INCLUDED 7 #define ABTU_H_INCLUDED 15 #ifdef ABT_CONFIG_HAVE___BUILTIN_EXPECT 16 #define ABTU_likely(cond) __builtin_expect(!!(cond), 1) 17 #define ABTU_unlikely(cond) __builtin_expect(!!(cond), 0) 19 #define ABTU_likely(cond) (cond) 20 #define ABTU_unlikely(cond) (cond) 28 int ret = posix_memalign(&p_ptr, alignment, size);
37 #ifdef ABT_CONFIG_USE_ALIGNED_ALLOC 52 memset(ptr, 0, num * size);
56 static inline void *
ABTU_realloc(
void *ptr,
size_t old_size,
size_t new_size)
59 memcpy(new_ptr, ptr, (old_size < new_size) ? old_size : new_size);
71 static inline void *
ABTU_calloc(
size_t num,
size_t size)
73 return calloc(num, size);
76 static inline void *
ABTU_realloc(
void *ptr,
size_t old_size,
size_t new_size)
79 return realloc(ptr, new_size);
84 #define ABTU_strcpy(d, s) strcpy(d, s) 85 #define ABTU_strncpy(d, s, n) strncpy(d, s, n) int ABTU_get_int_len(size_t num)
char * ABTU_get_indent_str(int indent)
static void * ABTU_malloc(size_t size)
#define ABT_CONFIG_STATIC_CACHELINE_SIZE
static void * ABTU_realloc(void *ptr, size_t old_size, size_t new_size)
static void * ABTU_memalign(size_t alignment, size_t size)
static void ABTU_free(void *ptr)
static void * ABTU_calloc(size_t num, size_t size)