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 7c3f5c3 commit 9522ef8Copy full SHA for 9522ef8
include/rtdef.h
@@ -386,6 +386,16 @@ typedef int (*init_fn_t)(void);
386
387
/**@}*/
388
389
+/**
390
+ * @ingroup BasicDef
391
+ *
392
+ * @def RT_IS_ALIGN(addr, align)
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
+ */
397
+#define RT_IS_ALIGN(addr, align) (!(addr & (align - 1)))
398
+
399
/**
400
* @ingroup BasicDef
401
*
0 commit comments