In gcc/objc/: 2011-04-12 Nicola Pero <nicola.pero@meta-innovation.com>
[official-gcc.git] / libgo / runtime / go-map-len.c
blob75b7473390dd615a9a75b9adb27b75ec846d8e16
1 /* go-map-len.c -- return the length of a map.
3 Copyright 2009 The Go Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file. */
7 #include <stddef.h>
9 #include "map.h"
11 /* Return the length of a map. This could be done inline, of course,
12 but I'm doing it as a function for now to make it easy to chang the
13 map structure. */
15 size_t
16 __go_map_len (struct __go_map *map)
18 if (map == NULL)
19 return 0;
20 return map->__element_count;