diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-26 10:47:29 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-26 10:47:29 +0100 |
commit | 6d3c5e4301df363055dc256e6692c610e4d0b918 (patch) | |
tree | a07a18ed1a13d50990cf0e43a2a3c919cb14240d /py/misc.h | |
parent | d139c489bab6b58906868e3fc8383ea813a122d4 (diff) |
Add ARRAY_SIZE macro, and use it where possible.
Diffstat (limited to 'py/misc.h')
-rw-r--r-- | py/misc.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |