1 /* go-construct-map.c -- construct a map from an initializer.
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. */
14 __go_construct_map (const struct __go_map_descriptor *descriptor,
15 uintptr_t count, uintptr_t entry_size,
16 uintptr_t val_offset, uintptr_t val_size,
20 const unsigned char *entries;
23 ret = __go_new_map (descriptor, count);
25 entries = (const unsigned char *) ventries;
26 for (i = 0; i < count; ++i)
28 void *val = __go_map_index (ret, entries, 1);
29 __builtin_memcpy (val, entries + val_offset, val_size);
30 entries += entry_size;