diff options
| author | ricky <[email protected]> | 2025-04-18 17:07:57 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-18 17:07:57 +0800 |
| commit | 7125e7bebd512a24427a7971ac1aff9acbae8668 (patch) | |
| tree | afc67879a73c1dbbb52122cf0014e9c04e68c933 /components/libc/cplusplus/cpp11/gcc/utils.cpp | |
| parent | 443c530c3c0e7235af03ffd1b2196369faf8e379 (diff) | |
include:rtdef.h: comment Refine the annotation of RT_ALIGN and RT_ALIGN_DOWN (#10201)
include :rtdef.h : [ Refine the annotation of RT_ALIGN and RT_ALIGN_DOWN ]
This macro is vulnerable to non-2-byte alignments,
but I assume that the macro definition was designed with an explicit use case of 2-byte alignments in mind.
Therefore, I only modify the comment to remind the user.
Solution:
RT_ALIGN(size, align) ((size) + (align) - 1) / (align) * (align)
RT_ALIGN_DOWN(size, align) (size) / (align) * (align)
Here's what deepseek recommends more.
Signed-off-by: Yucai Liu <[email protected]>
Diffstat (limited to 'components/libc/cplusplus/cpp11/gcc/utils.cpp')
0 files changed, 0 insertions, 0 deletions
