/* go-construct-map.c -- construct a map from an initializer. Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */#include <stddef.h>#include <stdlib.h>#include "map.h"struct__go_map*__go_construct_map(conststruct__go_map_descriptor*descriptor,size_tcount,size_tentry_size,size_tval_offset,size_tval_size,constvoid*ventries){struct__go_map*ret;constunsignedchar*entries;size_ti;ret=__go_new_map(descriptor,count);entries=(constunsignedchar*)ventries;for(i=0;i<count;++i){void*val=__go_map_index(ret,entries,1);__builtin_memcpy(val,entries+val_offset,val_size);entries+=entry_size;}returnret;}