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. */
13 struct __go_open_array
14 __go_string_to_int_array (struct __go_string str)
17 const unsigned char *p;
18 const unsigned char *pend;
21 struct __go_open_array ret;
25 pend = p + str.__length;
31 p += __go_get_rune (p, pend - p, &rune);
34 data = (uint32_t *) runtime_mallocgc (c * sizeof (uint32_t), FlagNoPointers,
42 p += __go_get_rune (p, pend - p, &rune);
46 ret.__values = (void *) data;