umem 1.0.1
sol_compat.h File Reference
#include "config.h"
#include <stdint.h>
#include <pthread.h>
#include <sys/time.h>

Go to the source code of this file.

Macros

#define THR_RETURN   void *
 
#define THR_API
 
#define INLINE   inline
 
#define thr_self()
 
#define thr_sigsetmask   pthread_sigmask
 
#define THR_BOUND   1
 
#define THR_DETACHED   2
 
#define THR_DAEMON   4
 
#define mutex_init(mp, type, arg)
 
#define mutex_lock(mp)
 
#define mutex_unlock(mp)
 
#define mutex_destroy(mp)
 
#define mutex_trylock(mp)
 
#define DEFAULTMUTEX   PTHREAD_MUTEX_INITIALIZER
 
#define DEFAULTCV   PTHREAD_COND_INITIALIZER
 
#define MUTEX_HELD(mp)
 
#define cond_init(c, type, arg)
 
#define cond_wait(c, m)
 
#define _cond_wait(c, m)
 
#define cond_signal(c)
 
#define cond_broadcast(c)
 
#define cond_destroy(c)
 
#define cond_timedwait   pthread_cond_timedwait
 
#define _cond_timedwait   pthread_cond_timedwait
 
#define RTLD_FIRST   0
 
#define ec_atomic_inc64(a)
 
#define P2PHASE(x, align)
 
#define P2ALIGN(x, align)
 
#define P2NPHASE(x, align)
 
#define P2ROUNDUP(x, align)
 
#define P2END(x, align)
 
#define P2PHASEUP(x, align, phase)
 
#define P2CROSS(x, y, align)
 
#define P2SAMEHIGHBIT(x, y)
 
#define IS_P2ALIGNED(v, a)
 
#define ISP2(x)
 
#define atomic_add_64(lvalptr, delta)
 
#define atomic_add_32_nv(a, b)
 
#define NANOSEC   1000000000
 
#define issetugid()
 
#define _sysconf(a)
 
#define __NORETURN   __attribute__ ((noreturn))
 
#define EC_UMEM_DUMMY_PCSTACK   1
 
#define MIN(a, b)
 
#define MAX(a, b)
 

Typedefs

typedef pthread_t thread_t
 
typedef pthread_mutex_t mutex_t
 
typedef pthread_cond_t cond_t
 
typedef u_int64_t hrtime_t
 
typedef uint32_t uint_t
 
typedef unsigned long ulong_t
 
typedef struct timespec timestruc_t
 
typedef long long longlong_t
 
typedef struct timespec timespec_t
 

Macro Definition Documentation

◆ __NORETURN

#define __NORETURN   __attribute__ ((noreturn))

◆ _cond_timedwait

#define _cond_timedwait   pthread_cond_timedwait

◆ _cond_wait

#define _cond_wait ( c,
m )
Value:
pthread_cond_wait(c, m)

Referenced by umem_init(), and vmem_xalloc().

◆ _sysconf

#define _sysconf ( a)
Value:
sysconf(a)

Referenced by umem_type_init(), and vmem_mmap_arena().

◆ atomic_add_32_nv

#define atomic_add_32_nv ( a,
b )
Value:
ec_atomic_inc(a)

Referenced by vmem_create().

◆ atomic_add_64

#define atomic_add_64 ( lvalptr,
delta )
Value:
#define ec_atomic_inc64(a)
Definition sol_compat.h:142

Referenced by _umem_cache_alloc().

◆ cond_broadcast

#define cond_broadcast ( c)

◆ cond_destroy

#define cond_destroy ( c)
Value:
pthread_cond_destroy(c)

Referenced by vmem_destroy().

◆ cond_init

#define cond_init ( c,
type,
arg )
Value:
pthread_cond_init(c, NULL)

Referenced by vmem_create().

◆ cond_signal

#define cond_signal ( c)
Value:
pthread_cond_signal(c)

◆ cond_timedwait

#define cond_timedwait   pthread_cond_timedwait

◆ cond_wait

#define cond_wait ( c,
m )
Value:
pthread_cond_wait(c, m)

◆ DEFAULTCV

#define DEFAULTCV   PTHREAD_COND_INITIALIZER

◆ DEFAULTMUTEX

#define DEFAULTMUTEX   PTHREAD_MUTEX_INITIALIZER

Referenced by vmem_heap_arena().

◆ ec_atomic_inc64

#define ec_atomic_inc64 ( a)
Value:
(*a)++

◆ EC_UMEM_DUMMY_PCSTACK

#define EC_UMEM_DUMMY_PCSTACK   1

◆ INLINE

#define INLINE   inline

◆ IS_P2ALIGNED

#define IS_P2ALIGNED ( v,
a )
Value:
((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)

◆ ISP2

#define ISP2 ( x)
Value:
(((x) & ((x) - 1)) == 0)

Referenced by vmem_sbrk_arena().

◆ issetugid

#define issetugid ( )
Value:
(geteuid() == 0)

Referenced by umem_error_enter(), umem_init(), and vmem_sbrk_arena().

◆ MAX

#define MAX ( a,
b )
Value:
((a) > (b) ? (a) : (b))

Referenced by _sbrk_grow_aligned(), umem_cache_create(), and vmem_xalloc().

◆ MIN

#define MIN ( a,
b )
Value:
((a) < (b) ? (a) : (b))

Referenced by realloc(), umem_cache_create(), vmem_create(), and vmem_xalloc().

◆ mutex_destroy

#define mutex_destroy ( mp)
Value:
pthread_mutex_destroy(mp)

Referenced by umem_cache_create(), umem_cache_destroy(), and vmem_destroy().

◆ MUTEX_HELD

#define MUTEX_HELD ( mp)
Value:
1 /* not really, but only used in an assert */

Referenced by umem_cache_update(), umem_create_update_thread(), and umem_process_updates().

◆ mutex_init

#define mutex_init ( mp,
type,
arg )
Value:
pthread_mutex_init(mp, NULL)

Referenced by umem_cache_create(), and vmem_create().

◆ mutex_lock

◆ mutex_trylock

#define mutex_trylock ( mp)
Value:
pthread_mutex_trylock(mp)

◆ mutex_unlock

◆ NANOSEC

#define NANOSEC   1000000000

Referenced by hrt2ts(), and umem_init().

◆ P2ALIGN

#define P2ALIGN ( x,
align )
Value:
((x) & -(align))

Referenced by vmem_alloc(), and vmem_xalloc().

◆ P2CROSS

#define P2CROSS ( x,
y,
align )
Value:
(((x) ^ (y)) > (align) - 1)

Referenced by vmem_xalloc().

◆ P2END

#define P2END ( x,
align )
Value:
(-(~(x) & -(align)))

◆ P2NPHASE

#define P2NPHASE ( x,
align )
Value:
(-(x) & ((align) - 1))

Referenced by umem_cache_create(), and vmem_xalloc().

◆ P2PHASE

#define P2PHASE ( x,
align )
Value:
((x) & ((align) - 1))

Referenced by memalign(), umem_cache_create(), and vmem_xalloc().

◆ P2PHASEUP

#define P2PHASEUP ( x,
align,
phase )
Value:
((phase) - (((phase) - (x)) & -(align)))

Referenced by vmem_xalloc().

◆ P2ROUNDUP

#define P2ROUNDUP ( x,
align )
Value:
(-(-(x) & -(align)))

Referenced by _sbrk_grow_aligned(), umem_cache_create(), vmem_no_debug(), vmem_xalloc(), and vmem_xfree().

◆ P2SAMEHIGHBIT

#define P2SAMEHIGHBIT ( x,
y )
Value:
(((x) ^ (y)) < ((x) & (y)))

◆ RTLD_FIRST

#define RTLD_FIRST   0

Referenced by umem_setup_envvars().

◆ THR_API

#define THR_API

Referenced by _cond_timedwait().

◆ THR_BOUND

#define THR_BOUND   1

◆ THR_DAEMON

#define THR_DAEMON   4

◆ THR_DETACHED

#define THR_DETACHED   2

◆ THR_RETURN

#define THR_RETURN   void *

Referenced by _cond_timedwait().

◆ thr_self

#define thr_self ( )
Value:
pthread_self()

Referenced by umem_cache_create(), umem_init(), and vmem_heap_arena().

◆ thr_sigsetmask

#define thr_sigsetmask   pthread_sigmask

Typedef Documentation

◆ cond_t

typedef pthread_cond_t cond_t

◆ hrtime_t

typedef u_int64_t hrtime_t

◆ longlong_t

typedef long long longlong_t

◆ mutex_t

typedef pthread_mutex_t mutex_t

◆ thread_t

typedef pthread_t thread_t

◆ timespec_t

typedef struct timespec timespec_t

◆ timestruc_t

typedef struct timespec timestruc_t

◆ uint_t

typedef uint32_t uint_t

◆ ulong_t

typedef unsigned long ulong_t