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. */
13 extern void *makemap (const struct __go_map_type
*, int64_t hint
,
15 __asm__ (GOSYM_PREFIX
"runtime.makemap");
17 extern void mapassign1 (const struct __go_map_type
*, void *hmap
,
18 const void *key
, const void *val
)
19 __asm__ (GOSYM_PREFIX
"runtime.mapassign1");
22 __go_construct_map (const struct __go_map_type
*type
,
23 uintptr_t count
, uintptr_t entry_size
,
24 uintptr_t val_offset
, const void *ventries
)
27 const unsigned char *entries
;
30 ret
= makemap(type
, (int64_t) count
, NULL
, NULL
);
32 entries
= (const unsigned char *) ventries
;
33 for (i
= 0; i
< count
; ++i
)
35 mapassign1 (type
, ret
, entries
, entries
+ val_offset
);
36 entries
+= entry_size
;