array.h 919 B

1234567891011121314151617181920212223242526272829
  1. /* array.h -- the open array type for Go.
  2. Copyright 2009 The Go Authors. All rights reserved.
  3. Use of this source code is governed by a BSD-style
  4. license that can be found in the LICENSE file. */
  5. #ifndef LIBGO_ARRAY_H
  6. #define LIBGO_ARRAY_H
  7. /* An open array is an instance of this structure. */
  8. struct __go_open_array
  9. {
  10. /* The elements of the array. In use in the compiler this is a
  11. pointer to the element type. */
  12. void* __values;
  13. /* The number of elements in the array. Note that this is "int",
  14. not "size_t". The language definition says that "int" is large
  15. enough to hold the size of any allocated object. Using "int"
  16. saves 8 bytes per slice header on a 64-bit system with 32-bit
  17. ints. */
  18. intgo __count;
  19. /* The capacity of the array--the number of elements that can fit in
  20. the __VALUES field. */
  21. intgo __capacity;
  22. };
  23. #endif /* !defined(LIBGO_ARRAY_H) */