B2BITS FIX Antenna HFT  1.0.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Typedefs | Functions
platform_win.h File Reference
#include "winpthreads.h"
#include <stdio.h>
#include <io.h>
#include <time.h>
#include <assert.h>
+ Include dependency graph for platform_win.h:

Macros

#define _SNPRINTF   _snprintf
 
#define ALLOC_BIG_CHUNK   malloc
 
#define atomic_bool_compare_swap32(ptr, oldval, newval)   (InterlockedCompareExchange( (ptr), (newval), (oldval) ) == (oldval))
 
#define atomic_bool_compare_swap64(ptr, oldval, newval)   (InterlockedCompareExchange64( (ptr), (newval), (oldval) ) == (oldval))
 
#define atomic_clear_bit(ptr, bit)   _InterlockedAnd((ptr), ~(1<<(bit)))
 
#define atomic_decr32(x)   InterlockedDecrement( static_cast<volatile long*>(x) )
 
#define atomic_incr32(x)   InterlockedIncrement( static_cast<volatile long*>(x) )
 
#define atomic_incr64(x)   InterlockedIncrement64( static_cast<volatile long long*>(x) )
 
#define atomic_set_bit(ptr, bit)   _InterlockedOr((ptr), 1<<(bit))
 
#define ATOMIC_T   long
 
#define atomic_test_and_clear_bit(ptr, bit)   ( !! (_InterlockedAnd((ptr), ~(1<<(bit))) & (1<<(bit))) )
 
#define ATOMIC_TEST_AND_SET(x)   (!InterlockedExchange(x, 1))
 
#define atomic_test_and_set_bit(ptr, bit)   ( ! (_InterlockedOr((ptr), 1<<(bit)) & (1<<(bit))) )
 
#define BARRIER()   _ReadWriteBarrier()
 
#define CALLOC   calloc
 
#define cpu_relax()   _mm_pause()
 
#define FLATTEN
 
#define FORMAT_STRING(p)   p
 
#define FREE   free
 
#define HOT
 
#define likely(x)   x
 
#define MALLOC   malloc
 
#define MB   MemoryBarrier
 
#define MEMCPY   memcpy
 
#define MEMMOVE   memmove
 
#define MEMSET   memset
 
#define popcnt64   __popcnt64
 
#define PRAGMA_SIMD
 
#define PRAGMA_VECTOR_ALIGNED
 
#define prefetch(x)
 
#define prefetch_range(addr, len)
 
#define RD_LOCK   pthread_rwlock_rdlock
 
#define RD_UNLOCK   pthread_rwlock_unlock
 
#define read_prefetch(x)
 
#define REALLOC   realloc
 
#define RWLOCK_FINI(x)   pthread_rwlock_destroy(x)
 
#define RWLOCK_INIT(x)   pthread_rwlock_init((x), 0)
 
#define RWLOCK_T   pthread_rwlock_t
 
#define SPIN_LOCK   pthread_spin_lock
 
#define SPIN_TRYLOCK   pthread_spin_trylock
 
#define SPIN_UNLOCK   pthread_spin_unlock
 
#define SPINLOCK_FINI(x)   pthread_spin_destroy(x)
 
#define SPINLOCK_INIT(x)   pthread_spin_init((x), 0)
 
#define SPINLOCK_T   pthread_spinlock_t
 
#define test_bit(ptr, bit)   (!!(*(ptr) & (1<<(bit))))
 
#define test_mask(ptr, mask)   (!!(*(ptr) & (mask)))
 
#define unlikely(x)   x
 
#define WR_LOCK   pthread_rwlock_wrlock
 
#define WR_UNLOCK   pthread_rwlock_unlock
 
#define write_prefetch(x)
 

Typedefs

typedef volatile long ATOMIC32_T
 
typedef volatile long long ATOMIC64_T
 
typedef short int16_t
 
typedef int int32_t
 
typedef long long int int64_t
 
typedef unsigned short uint16_t
 
typedef unsigned int uint32_t
 
typedef unsigned long long int uint64_t
 
typedef unsigned char uint8_t
 

Functions

void _mm_pause ()
 
static time_t get_seconds ()
 
static unsigned long long getFrequency ()
 
static unsigned long long getPerfCount ()
 
static void sleepms (int ms)
 
static void usleep (__int64 waitUsec)
 

Macro Definition Documentation

#define _SNPRINTF   _snprintf
#define ALLOC_BIG_CHUNK   malloc
#define atomic_bool_compare_swap32 (   ptr,
  oldval,
  newval 
)    (InterlockedCompareExchange( (ptr), (newval), (oldval) ) == (oldval))
#define atomic_bool_compare_swap64 (   ptr,
  oldval,
  newval 
)    (InterlockedCompareExchange64( (ptr), (newval), (oldval) ) == (oldval))
#define atomic_clear_bit (   ptr,
  bit 
)    _InterlockedAnd((ptr), ~(1<<(bit)))
#define atomic_decr32 (   x)    InterlockedDecrement( static_cast<volatile long*>(x) )
#define atomic_incr32 (   x)    InterlockedIncrement( static_cast<volatile long*>(x) )
#define atomic_incr64 (   x)    InterlockedIncrement64( static_cast<volatile long long*>(x) )
#define atomic_set_bit (   ptr,
  bit 
)    _InterlockedOr((ptr), 1<<(bit))
#define ATOMIC_T   long
#define atomic_test_and_clear_bit (   ptr,
  bit 
)    ( !! (_InterlockedAnd((ptr), ~(1<<(bit))) & (1<<(bit))) )
#define ATOMIC_TEST_AND_SET (   x)    (!InterlockedExchange(x, 1))
#define atomic_test_and_set_bit (   ptr,
  bit 
)    ( ! (_InterlockedOr((ptr), 1<<(bit)) & (1<<(bit))) )
#define BARRIER ( )    _ReadWriteBarrier()
#define CALLOC   calloc
#define cpu_relax ( )    _mm_pause()
#define FLATTEN
#define FORMAT_STRING (   p)    p
#define FREE   free
#define HOT
#define likely (   x)    x
#define MALLOC   malloc
#define MB   MemoryBarrier
#define MEMCPY   memcpy
#define MEMMOVE   memmove
#define MEMSET   memset
#define popcnt64   __popcnt64
#define PRAGMA_SIMD
#define PRAGMA_VECTOR_ALIGNED
#define prefetch (   x)
#define prefetch_range (   addr,
  len 
)
#define RD_LOCK   pthread_rwlock_rdlock
#define RD_UNLOCK   pthread_rwlock_unlock
#define read_prefetch (   x)
#define REALLOC   realloc
#define RWLOCK_FINI (   x)    pthread_rwlock_destroy(x)
#define RWLOCK_INIT (   x)    pthread_rwlock_init((x), 0)
#define RWLOCK_T   pthread_rwlock_t
#define SPIN_LOCK   pthread_spin_lock
#define SPIN_TRYLOCK   pthread_spin_trylock
#define SPIN_UNLOCK   pthread_spin_unlock
#define SPINLOCK_FINI (   x)    pthread_spin_destroy(x)
#define SPINLOCK_INIT (   x)    pthread_spin_init((x), 0)
#define SPINLOCK_T   pthread_spinlock_t
#define test_bit (   ptr,
  bit 
)    (!!(*(ptr) & (1<<(bit))))
#define test_mask (   ptr,
  mask 
)    (!!(*(ptr) & (mask)))
#define unlikely (   x)    x
#define WR_LOCK   pthread_rwlock_wrlock
#define WR_UNLOCK   pthread_rwlock_unlock
#define write_prefetch (   x)

Typedef Documentation

typedef volatile long ATOMIC32_T
typedef volatile long long ATOMIC64_T
typedef short int16_t
typedef int int32_t
typedef long long int int64_t
typedef unsigned short uint16_t
typedef unsigned int uint32_t
typedef unsigned long long int uint64_t
typedef unsigned char uint8_t

Function Documentation

void _mm_pause ( )
static time_t get_seconds ( )
inlinestatic
static unsigned long long getFrequency ( )
inlinestatic
static unsigned long long getPerfCount ( )
inlinestatic
static void sleepms ( int  ms)
inlinestatic
static void usleep ( __int64  waitUsec)
inlinestatic

Referenced by sleepms().