We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e36b97f commit 780806fCopy full SHA for 780806f
include/rtdef.h
@@ -393,8 +393,9 @@ typedef int (*init_fn_t)(void);
393
* Return true(1) or false(0).
394
* RT_IS_ALIGN(128, 4) is judging whether 128 aligns with 4.
395
* The result is 1, which means 128 aligns with 4.
396
+ * @note If the address is NULL, false(0) will be returned
397
*/
-#define RT_IS_ALIGN(addr, align) (!(addr & (align - 1)))
398
+#define RT_IS_ALIGN(addr, align) ((!(addr & (align - 1))) && (addr != RT_NULL))
399
400
/**
401
* @ingroup BasicDef
0 commit comments