| 1 |
/* array.h -- the open array type for Go. |
| 2 |
|
| 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. */ |
| 6 |
|
| 7 |
#ifndef LIBGO_ARRAY_H |
| 8 |
#define LIBGO_ARRAY_H |
| 9 |
|
| 10 |
/* An open array is an instance of this structure. */ |
| 11 |
|
| 12 |
struct __go_open_array |
| 13 |
{ |
| 14 |
/* The elements of the array. In use in the compiler this is a |
| 15 |
pointer to the element type. */ |
| 16 |
void* __values; |
| 17 |
/* The number of elements in the array. Note that this is "int", |
| 18 |
not "size_t". The language definition says that "int" is large |
| 19 |
enough to hold the size of any allocated object. Using "int" |
| 20 |
saves 8 bytes per slice header on a 64-bit system with 32-bit |
| 21 |
ints. */ |
| 22 |
intgo __count; |
| 23 |
/* The capacity of the array--the number of elements that can fit in |
| 24 |
the __VALUES field. */ |
| 25 |
intgo __capacity; |
| 26 |
}; |
| 27 |
|
| 28 |
#endif /* !defined(LIBGO_ARRAY_H) */ |