Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/rtdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ typedef int (*init_fn_t)(void);
* @def RT_ALIGN(size, align)
* Return the most contiguous size aligned at specified width. RT_ALIGN(13, 4)
* would return 16.
* @note align Must be an integer power of 2 or the result will be incorrect
*/
#define RT_ALIGN(size, align) (((size) + (align) - 1) & ~((align) - 1))

Expand All @@ -260,6 +261,7 @@ typedef int (*init_fn_t)(void);
* @def RT_ALIGN_DOWN(size, align)
* Return the down number of aligned at specified width. RT_ALIGN_DOWN(13, 4)
* would return 12.
* @note align Must be an integer power of 2 or the result will be incorrect
*/
#define RT_ALIGN_DOWN(size, align) ((size) & ~((align) - 1))

Expand Down