nano-client API Reference
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

Functions

const NANO_u8NANO_OSAPI_Memory_align_ptr (const NANO_u8 *ptr, NANO_u8 alignment)
 TODO. More...
 
NANO_usize NANO_OSAPI_Memory_align_size_up (NANO_usize size, NANO_usize alignment)
 Increase a "size" value to the next greater or equal value that is also properly align at the specified boundary. More...
 

Detailed Description

Function Documentation

◆ NANO_OSAPI_Memory_align_ptr()

const NANO_u8* NANO_OSAPI_Memory_align_ptr ( const NANO_u8 ptr,
NANO_u8  alignment 
)

TODO.

Parameters
ptr
alignment
Returns
const NANO_u8*

◆ NANO_OSAPI_Memory_align_size_up()

NANO_usize NANO_OSAPI_Memory_align_size_up ( NANO_usize  size,
NANO_usize  alignment 
)

Increase a "size" value to the next greater or equal value that is also properly align at the specified boundary.

E.g.:

  • size = 1, alignment = 8, return = 8
  • size = 4, alignment = 2, return = 4
Parameters
sizeThe value to align.
alignmentThe desired alignment.
Returns
A value that is greater or equal to size and it is aligned at the specified boundary.