r6:API:Abstraction (liblfds)

From liblfds.org
Revision as of 14:07, 4 January 2015 by Admin (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source Files

/src/abstraction/abstraction_aligned_free.c
/src/abstraction/abstraction_aligned_malloc.c
/src/abstraction/abstraction_cas.c
/src/abstraction/abstraction_dcas.c
/src/abstraction/abstraction_increment.c
/inc/liblfds.h

Prototypes

void abstraction_aligned_free( void *memory );
void *abstraction_aligned_malloc( size_t size, size_t align_in_bytes );
atom_t abstraction_cas( volatile atom_t *destination, atom_t exchange, atom_t compare )
unsigned char abstraction_dcas( volatile atom_t *destination, atom_t *exchange, atom_t *compare );
atom_t abstraction_increment( atom_t *value );

Defines & Typedefs

typedef [type] atom_t;

#define INLINE                [compiler inline directive]
#define ALIGN(alignment)      [compiler stack alignment directive]
#define ALIGN_SINGLE_POINTER  [atom_t size in bytes]
#define ALIGN_DOUBLE_POINTER  [atom_t size in bytes, multiplied by two]

Overview

This API is not a data structure. It is the abstraction layer for liblfds, which must be implemented on a given platform for liblfds to compile and run on that platform.

Please read the porting guide for detailed instructions.

Notes

Extern inline functions, for both GCC and MSVC, require the public prototype to be declared without the inline keyword while the function definition is declared with the inline keyword.