1 /* go-string-to-int-array.c -- convert a string to an array of ints in Go.
3 Copyright 2010 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 struct __go_open_array
15 __go_string_to_int_array (struct __go_string str)
18 const unsigned char *p;
19 const unsigned char *pend;
22 struct __go_open_array ret;
26 pend = p + str.__length;
32 p += __go_get_rune (p, pend - p, &rune);
35 data = (uint32_t *) runtime_mallocgc (c * sizeof (uint32_t), FlagNoPointers,
43 p += __go_get_rune (p, pend - p, &rune);
47 ret.__values = (void *) data;