ARGOBOTS  1.1
Macros | Typedefs | Enumerations | Functions
abtu.h File Reference
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "abt_config.h"
Include dependency graph for abtu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ABTU_likely(cond)   (cond)
 
#define ABTU_unlikely(cond)   (cond)
 
#define ABTU_noreturn
 
#define ABTU_alignof(type)   16 /* 16 bytes would be a good guess. */
 
#define ABTU_MAX_ALIGNMENT   ABTU_max_size(ABTU_alignof(long double), ABTU_alignof(long long))
 
#define ABTU_ret_err
 
#define ABTU_align_member_var(size)   __attribute__((aligned(size)))
 
#define ABTU_no_sanitize_address
 

Typedefs

typedef enum ABTU_MEM_LARGEPAGE_TYPE ABTU_MEM_LARGEPAGE_TYPE
 

Enumerations

enum  ABTU_MEM_LARGEPAGE_TYPE { ABTU_MEM_LARGEPAGE_MALLOC, ABTU_MEM_LARGEPAGE_MEMALIGN, ABTU_MEM_LARGEPAGE_MMAP, ABTU_MEM_LARGEPAGE_MMAP_HUGEPAGE }
 

Functions

static int ABTU_max_int (int a, int b)
 
static int32_t ABTU_max_int32 (int32_t a, int32_t b)
 
static uint32_t ABTU_max_uint32 (uint32_t a, uint32_t b)
 
static int64_t ABTU_max_int64 (int64_t a, int64_t b)
 
static uint64_t ABTU_max_uint64 (uint64_t a, uint64_t b)
 
static size_t ABTU_max_size (size_t a, size_t b)
 
static int ABTU_min_int (int a, int b)
 
static int32_t ABTU_min_int32 (int32_t a, int32_t b)
 
static uint32_t ABTU_min_uint32 (uint32_t a, uint32_t b)
 
static int64_t ABTU_min_int64 (int64_t a, int64_t b)
 
static uint64_t ABTU_min_uint64 (uint64_t a, uint64_t b)
 
static size_t ABTU_min_size (size_t a, size_t b)
 
static uint32_t ABTU_roundup_uint32 (uint32_t val, uint32_t multiple)
 
static uint64_t ABTU_roundup_uint64 (uint64_t val, uint64_t multiple)
 
static size_t ABTU_roundup_size (size_t val, size_t multiple)
 
static ABTU_noreturn void ABTU_unreachable (void)
 
static ABTU_ret_err int ABTU_memalign (size_t alignment, size_t size, void **p_ptr)
 
static void ABTU_free (void *ptr)
 
static ABTU_ret_err int ABTU_malloc (size_t size, void **p_ptr)
 
static ABTU_ret_err int ABTU_calloc (size_t num, size_t size, void **p_ptr)
 
static ABTU_ret_err int ABTU_realloc (size_t old_size, size_t new_size, void **p_ptr)
 
int ABTU_is_supported_largepage_type (size_t size, size_t alignment_hint, ABTU_MEM_LARGEPAGE_TYPE requested)
 
ABTU_ret_err int ABTU_alloc_largepage (size_t size, size_t alignment_hint, const ABTU_MEM_LARGEPAGE_TYPE *requested_types, int num_requested_types, ABTU_MEM_LARGEPAGE_TYPE *p_actual, void **p_ptr)
 
void ABTU_free_largepage (void *ptr, size_t size, ABTU_MEM_LARGEPAGE_TYPE type)
 
ABTU_ret_err int ABTU_atoi (const char *str, int *p_val, ABT_bool *p_overflow)
 
ABTU_ret_err int ABTU_atoui32 (const char *str, uint32_t *p_val, ABT_bool *p_overflow)
 
ABTU_ret_err int ABTU_atoui64 (const char *str, uint64_t *p_val, ABT_bool *p_overflow)
 
ABTU_ret_err int ABTU_atosz (const char *str, size_t *p_val, ABT_bool *p_overflow)
 

Macro Definition Documentation

◆ ABTU_align_member_var

#define ABTU_align_member_var (   size)    __attribute__((aligned(size)))

Definition at line 159 of file abtu.h.

◆ ABTU_alignof

#define ABTU_alignof (   type)    16 /* 16 bytes would be a good guess. */

Definition at line 138 of file abtu.h.

◆ ABTU_likely

#define ABTU_likely (   cond)    (cond)

Definition at line 111 of file abtu.h.

◆ ABTU_MAX_ALIGNMENT

#define ABTU_MAX_ALIGNMENT   ABTU_max_size(ABTU_alignof(long double), ABTU_alignof(long long))

Definition at line 140 of file abtu.h.

◆ ABTU_no_sanitize_address

#define ABTU_no_sanitize_address

Definition at line 200 of file abtu.h.

◆ ABTU_noreturn

#define ABTU_noreturn

Definition at line 118 of file abtu.h.

◆ ABTU_ret_err

#define ABTU_ret_err

Definition at line 146 of file abtu.h.

◆ ABTU_unlikely

#define ABTU_unlikely (   cond)    (cond)

Definition at line 112 of file abtu.h.

Typedef Documentation

◆ ABTU_MEM_LARGEPAGE_TYPE

Enumeration Type Documentation

◆ ABTU_MEM_LARGEPAGE_TYPE

Enumerator
ABTU_MEM_LARGEPAGE_MALLOC 
ABTU_MEM_LARGEPAGE_MEMALIGN 
ABTU_MEM_LARGEPAGE_MMAP 
ABTU_MEM_LARGEPAGE_MMAP_HUGEPAGE 

Definition at line 297 of file abtu.h.

Function Documentation

◆ ABTU_alloc_largepage()

ABTU_ret_err int ABTU_alloc_largepage ( size_t  size,
size_t  alignment_hint,
const ABTU_MEM_LARGEPAGE_TYPE requested_types,
int  num_requested_types,
ABTU_MEM_LARGEPAGE_TYPE p_actual,
void **  p_ptr 
)

Definition at line 90 of file largepage.c.

Referenced by ABTI_mem_pool_take_bucket().

◆ ABTU_atoi()

ABTU_ret_err int ABTU_atoi ( const char *  str,
int *  p_val,
ABT_bool p_overflow 
)

Definition at line 11 of file atoi.c.

Referenced by load_env_int().

◆ ABTU_atosz()

ABTU_ret_err int ABTU_atosz ( const char *  str,
size_t *  p_val,
ABT_bool p_overflow 
)

Definition at line 85 of file atoi.c.

Referenced by load_env_size().

◆ ABTU_atoui32()

ABTU_ret_err int ABTU_atoui32 ( const char *  str,
uint32_t *  p_val,
ABT_bool p_overflow 
)

Definition at line 39 of file atoi.c.

Referenced by ABTU_atosz(), and load_env_uint32().

◆ ABTU_atoui64()

ABTU_ret_err int ABTU_atoui64 ( const char *  str,
uint64_t *  p_val,
ABT_bool p_overflow 
)

Definition at line 65 of file atoi.c.

Referenced by ABTU_atosz(), and load_env_uint64().

◆ ABTU_calloc()

static ABTU_ret_err int ABTU_calloc ( size_t  num,
size_t  size,
void **  p_ptr 
)
inlinestatic

◆ ABTU_free()

static void ABTU_free ( void *  ptr)
inlinestatic

◆ ABTU_free_largepage()

void ABTU_free_largepage ( void *  ptr,
size_t  size,
ABTU_MEM_LARGEPAGE_TYPE  type 
)

Definition at line 132 of file largepage.c.

Referenced by ABTI_mem_pool_destroy_global_pool().

◆ ABTU_is_supported_largepage_type()

int ABTU_is_supported_largepage_type ( size_t  size,
size_t  alignment_hint,
ABTU_MEM_LARGEPAGE_TYPE  requested 
)

Definition at line 59 of file largepage.c.

◆ ABTU_malloc()

static ABTU_ret_err int ABTU_malloc ( size_t  size,
void **  p_ptr 
)
inlinestatic

◆ ABTU_max_int()

static int ABTU_max_int ( int  a,
int  b 
)
inlinestatic

Definition at line 15 of file abtu.h.

Referenced by load_env_int().

◆ ABTU_max_int32()

static int32_t ABTU_max_int32 ( int32_t  a,
int32_t  b 
)
inlinestatic

Definition at line 20 of file abtu.h.

◆ ABTU_max_int64()

static int64_t ABTU_max_int64 ( int64_t  a,
int64_t  b 
)
inlinestatic

Definition at line 30 of file abtu.h.

◆ ABTU_max_size()

static size_t ABTU_max_size ( size_t  a,
size_t  b 
)
inlinestatic

Definition at line 40 of file abtu.h.

Referenced by load_env_size().

◆ ABTU_max_uint32()

static uint32_t ABTU_max_uint32 ( uint32_t  a,
uint32_t  b 
)
inlinestatic

Definition at line 25 of file abtu.h.

Referenced by load_env_uint32().

◆ ABTU_max_uint64()

static uint64_t ABTU_max_uint64 ( uint64_t  a,
uint64_t  b 
)
inlinestatic

Definition at line 35 of file abtu.h.

Referenced by load_env_uint64().

◆ ABTU_memalign()

static ABTU_ret_err int ABTU_memalign ( size_t  alignment,
size_t  size,
void **  p_ptr 
)
inlinestatic

Definition at line 205 of file abtu.h.

Referenced by ABTU_alloc_largepage(), and ABTU_is_supported_largepage_type().

◆ ABTU_min_int()

static int ABTU_min_int ( int  a,
int  b 
)
inlinestatic

Definition at line 45 of file abtu.h.

Referenced by load_env_int().

◆ ABTU_min_int32()

static int32_t ABTU_min_int32 ( int32_t  a,
int32_t  b 
)
inlinestatic

Definition at line 50 of file abtu.h.

◆ ABTU_min_int64()

static int64_t ABTU_min_int64 ( int64_t  a,
int64_t  b 
)
inlinestatic

Definition at line 60 of file abtu.h.

◆ ABTU_min_size()

static size_t ABTU_min_size ( size_t  a,
size_t  b 
)
inlinestatic

Definition at line 70 of file abtu.h.

Referenced by load_env_size().

◆ ABTU_min_uint32()

static uint32_t ABTU_min_uint32 ( uint32_t  a,
uint32_t  b 
)
inlinestatic

Definition at line 55 of file abtu.h.

Referenced by ABTD_env_init(), and load_env_uint32().

◆ ABTU_min_uint64()

static uint64_t ABTU_min_uint64 ( uint64_t  a,
uint64_t  b 
)
inlinestatic

Definition at line 65 of file abtu.h.

Referenced by load_env_uint64().

◆ ABTU_realloc()

static ABTU_ret_err int ABTU_realloc ( size_t  old_size,
size_t  new_size,
void **  p_ptr 
)
inlinestatic

Definition at line 283 of file abtu.h.

Referenced by ABTD_affinity_init(), and list_realloc().

◆ ABTU_roundup_size()

static size_t ABTU_roundup_size ( size_t  val,
size_t  multiple 
)
inlinestatic

◆ ABTU_roundup_uint32()

static uint32_t ABTU_roundup_uint32 ( uint32_t  val,
uint32_t  multiple 
)
inlinestatic

Definition at line 75 of file abtu.h.

Referenced by ABTD_env_init().

◆ ABTU_roundup_uint64()

static uint64_t ABTU_roundup_uint64 ( uint64_t  val,
uint64_t  multiple 
)
inlinestatic

Definition at line 85 of file abtu.h.

Referenced by ABTI_mem_register_stack(), and ABTI_mem_unregister_stack().

◆ ABTU_unreachable()

static ABTU_noreturn void ABTU_unreachable ( void  )
inlinestatic