Difference between pages "r7.1.1:Macro LFDS711 LIST ASU SET VALUE IN ELEMENT" and "r7.1.1:Macro LFDS711 PAL ALIGN"

From liblfds.org
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
m (1 revision imported)
 
Line 1: Line 1:
{{DISPLAYTITLE:macro LFDS711_LIST_ASU_SET_VALUE_IN_ELEMENT}}
{{DISPLAYTITLE:define LFDS711_PAL_ALIGN}}
==Source File==
==Source File==
  └───liblfds711
  └───liblfds711
     └───inc
     └───inc
         └───liblfds711
         └───liblfds711
                 lfds711_list_addonly_singlylinked_unordered.h
                 lfds711_porting_abstraction_layer_compiler.h
 
==Opaque Structures==
struct [[r7.1.1:struct lfds711_list_asu_element|lfds711_list_asu_element]];


==Macro==
==Macro==
  #define LFDS711_LIST_ASU_SET_VALUE_IN_ELEMENT( list_asu_element, new_value )
  #define LFDS711_PAL_ALIGN( alignment ) [compiler alignment directive]


==Parameters==
==Parameters==
''list_asu_element''
''alignment''
: A ''struct lfds711_list_asu_element''.  Not a pointer to it - the struct itself.
: Alignment in bytes.
 
''new_value''
: A void pointer, which the value in ''list_asu_element'' is set to.


==Return Value==
==Return Value==
No return value.
No return value.
==Example==
#define LFDS711_PAL_ALIGN(alignment)  __attribute__( (aligned(alignment)) )
==Optionality==
This define is mandatory and the library cannot compile if it is not set.


==Notes==
==Notes==
As with all ''liblfds'' macros, the macro operates on the structure itself, not a pointer to it.
Atomic instructions require the variables they operate upon to meet certain memory alignment requirements.


The value is set atomically, and so can be used at any time, on an element in the list or before it enters the list, unlike setting a key, which can only be done before an element enters the list.
This issue comes into play when making stack allocation, or positioning elements in structures for caching-line or exclusive reservation granule alignement and padding.


==Example==
This macro is the mechanism by which the compiler specific keyword for alignment is provided to liblfds.


==See Also==
==See Also==
* [[r7.1.1:List (add-only, singly-linked, unordered)|List (add-only, singly-linked, unordered)]]
* [[r7.1.1:Porting Guide (liblfds)|Porting Guide (liblfds)]]

Latest revision as of 18:12, 16 February 2017

Source File

└───liblfds711
    └───inc
        └───liblfds711
                lfds711_porting_abstraction_layer_compiler.h

Macro

#define LFDS711_PAL_ALIGN( alignment )  [compiler alignment directive]

Parameters

alignment

Alignment in bytes.

Return Value

No return value.

Example

#define LFDS711_PAL_ALIGN(alignment)  __attribute__( (aligned(alignment)) )

Optionality

This define is mandatory and the library cannot compile if it is not set.

Notes

Atomic instructions require the variables they operate upon to meet certain memory alignment requirements.

This issue comes into play when making stack allocation, or positioning elements in structures for caching-line or exclusive reservation granule alignement and padding.

This macro is the mechanism by which the compiler specific keyword for alignment is provided to liblfds.

See Also