summaryrefslogtreecommitdiffstatshomepage
path: root/py/misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'py/misc.h')
-rw-r--r--py/misc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/misc.h b/py/misc.h
index 002a97ffec..bf31f75354 100644
--- a/py/misc.h
+++ b/py/misc.h
@@ -52,6 +52,11 @@ int m_get_total_bytes_allocated(void);
int m_get_current_bytes_allocated(void);
int m_get_peak_bytes_allocated(void);
+/** array helpers ***********************************************/
+
+// get the number of elements in a fixed-size array
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+
/** unichar / UTF-8 *********************************************/
typedef int unichar; // TODO