reflect: implement ArrayOf

This change exposes reflect.ArrayOf to create new reflect.Type array
types at runtime, when given a reflect.Type element.

- reflect: implement ArrayOf
- reflect: tests for ArrayOf
- runtime: document that typeAlg is used by reflect and must be kept in
  synchronized

Fixes #5996.

Change-Id: I5d07213364ca915c25612deea390507c19461758
Reviewed-on: https://go-review.googlesource.com/4111
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Sebastien Binet 2015-01-27 10:04:11 +01:00 committed by Keith Randall
parent c0fa9e3f6f
commit 918fdae348
5 changed files with 307 additions and 33 deletions

View file

@ -15,7 +15,6 @@ func IsRO(v Value) bool {
return v.flag&flagRO != 0
}
var ArrayOf = arrayOf
var CallGC = &callGC
const PtrSize = ptrSize