function libshared_memory_init

From liblfds.org
Jump to navigation Jump to search

Source Files

└── test_and_benchmark
    └── libshared
        ├── inc
        │   └── libshared
        │       └── libshared_memory.h
        └── src
            └── libshared_memory
                └── libshared_memory_init.c

Opaque Structures

struct libshared_memory_state;

Prototype

void libshared_memory_init( struct libshared_memory_state *ms );

Parameters

struct libshared_memory_state *ms

A pointer to a user-allocated LFDS711_PAL_ATOMIC_ISOLATION_IN_BYTES aligned struct libshared_memory_state. Stack declared variables will automatically be correctly aligned by the compiler, due to the information in the structure definitions; nothing has to be done. Heap allocated variables however will by no means be correctly aligned and an aligned malloc must be used.

Notes

This is a single-threaded API. The initialized memory state structure can only be safely used by threads on the same logical core as the thread which called libshared_memory_init, which in practise means only that calling thread uses the struct.

Example

See Also