diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2012-05-08 13:32:12 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2012-10-25 10:15:59 -0700 |
commit | 80a21dc60fa007bb00437fdc047c3e059232639f (patch) | |
tree | 884fad4cd756c73e36232b6182e46d85ba64e229 | |
parent | f02a09925db53d3e1d29b1917ebbcaa8edf72c12 (diff) |
lib: add array_size() helper
implement array_size as sizeof(array) / sizeof(array element)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r-- | lib/memory.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/memory.h b/lib/memory.h index a7eddce4..23962235 100644 --- a/lib/memory.h +++ b/lib/memory.h @@ -21,6 +21,8 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #ifndef _ZEBRA_MEMORY_H #define _ZEBRA_MEMORY_H +#define array_size(ar) (sizeof(ar) / sizeof(ar[0])) + /* For pretty printing of memory allocate information. */ struct memory_list { |