summaryrefslogtreecommitdiffstatshomepage
path: root/py/misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'py/misc.h')
-rw-r--r--py/misc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/py/misc.h b/py/misc.h
index aac9072446..fe2b3b8afa 100644
--- a/py/misc.h
+++ b/py/misc.h
@@ -53,6 +53,9 @@ typedef unsigned int uint;
// Static assertion macro
#define MP_STATIC_ASSERT(cond) ((void)sizeof(char[1 - 2 * !(cond)]))
+// Round-up integer division
+#define MP_CEIL_DIVIDE(a, b) (((a) + (b) - 1) / (b))
+
/** memory allocation ******************************************/
// TODO make a lazy m_renew that can increase by a smaller amount than requested (but by at least 1 more element)