r6.1.0:LFDS610_INLINE

From liblfds.org
Jump to navigation Jump to search

Source File

/liblfds610/inc/liblfds610.h

Define

#define LFDS610_INLINE   [compiler inline directive]

Parameters

No parameters.

Return Value

No return value.

Notes

The atomic instructions used by liblfds in the end always come down to a single machine instruction. Part of the reason for using lock-free data structures is performance. As such, it is important to indicate to the compiler that it should if at all possible avoid the overhead of a function call every time one of the atomic instructions is called. To achieve this, compilers provide a keyword which permits the code author to indicate that a given function should be inlined. This macro is the mechanism by which the compiler specific keyword for stack alignment is provided to liblfds.

Examples

On Windows, with the Microsoft C compiler, there exists the keyword __forceinline.

As such, the implementation of LFDS610_INLINE on Windows with the Microsoft C compiler looks like this;

#define LFDS610_INLINE   __forceinline

With GCC, there exists the keyword inline.

As such, the implementation of LFDS610_INLINE on GCC looks like this;

#define LFDS610_INLINE   inline

See Also