annotate libgo/runtime/array.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* array.h -- the open array type for Go.
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 Copyright 2009 The Go Authors. All rights reserved.
kono
parents:
diff changeset
4 Use of this source code is governed by a BSD-style
kono
parents:
diff changeset
5 license that can be found in the LICENSE file. */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 #ifndef LIBGO_ARRAY_H
kono
parents:
diff changeset
8 #define LIBGO_ARRAY_H
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 /* An open array is an instance of this structure. */
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 struct __go_open_array
kono
parents:
diff changeset
13 {
kono
parents:
diff changeset
14 /* The elements of the array. In use in the compiler this is a
kono
parents:
diff changeset
15 pointer to the element type. */
kono
parents:
diff changeset
16 void* __values;
kono
parents:
diff changeset
17 /* The number of elements in the array. Note that this is "int",
kono
parents:
diff changeset
18 not "size_t". The language definition says that "int" is large
kono
parents:
diff changeset
19 enough to hold the size of any allocated object. Using "int"
kono
parents:
diff changeset
20 saves 8 bytes per slice header on a 64-bit system with 32-bit
kono
parents:
diff changeset
21 ints. */
kono
parents:
diff changeset
22 intgo __count;
kono
parents:
diff changeset
23 /* The capacity of the array--the number of elements that can fit in
kono
parents:
diff changeset
24 the __VALUES field. */
kono
parents:
diff changeset
25 intgo __capacity;
kono
parents:
diff changeset
26 };
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 #endif /* !defined(LIBGO_ARRAY_H) */