diff options
author | Russ Cox <rsc@golang.org> | 2015-04-28 00:28:47 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2015-05-11 14:43:33 +0000 |
commit | 6d8a147bef8ee28eb647db21ea91ecb823fa2480 (patch) | |
tree | 1c14bd4162ef484aa775232d3e5abc7a8a16774e /src/runtime/gcinfo_test.go | |
parent | 7d9e16abc6bea2eb12d718b578f91328af99586a (diff) | |
download | go-6d8a147bef8ee28eb647db21ea91ecb823fa2480.tar.gz go-6d8a147bef8ee28eb647db21ea91ecb823fa2480.zip |
runtime: use 1-bit pointer bitmaps in type representation
The type information in reflect.Type and the GC programs is now
1 bit per word, down from 2 bits.
The in-memory unrolled type bitmap representation are now
1 bit per word, down from 4 bits.
The conversion from the unrolled (now 1-bit) bitmap to the
heap bitmap (still 4-bit) is not optimized. A followup CL will
work on that, after the heap bitmap has been converted to 2-bit.
The typeDead optimization, in which a special value denotes
that there are no more pointers anywhere in the object, is lost
in this CL. A followup CL will bring it back in the final form of
heapBitsSetType.
Change-Id: If61e67950c16a293b0b516a6fd9a1c755b6d5549
Reviewed-on: https://go-review.googlesource.com/9702
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/gcinfo_test.go')
-rw-r--r-- | src/runtime/gcinfo_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/runtime/gcinfo_test.go b/src/runtime/gcinfo_test.go index 66b0353f08..b4ab9134aa 100644 --- a/src/runtime/gcinfo_test.go +++ b/src/runtime/gcinfo_test.go @@ -28,13 +28,13 @@ func TestGCInfo(t *testing.T) { verifyGCInfo(t, "data eface", &dataEface, infoEface) verifyGCInfo(t, "data iface", &dataIface, infoIface) - verifyGCInfo(t, "stack ScalarPtr", new(ScalarPtr), infoScalarPtr) - verifyGCInfo(t, "stack PtrScalar", new(PtrScalar), infoPtrScalar) - verifyGCInfo(t, "stack BigStruct", new(BigStruct), infoBigStruct()) - verifyGCInfo(t, "stack string", new(string), infoString) - verifyGCInfo(t, "stack slice", new([]string), infoSlice) - verifyGCInfo(t, "stack eface", new(interface{}), infoEface) - verifyGCInfo(t, "stack iface", new(Iface), infoIface) + verifyGCInfo(t, "stack ScalarPtr", new(ScalarPtr), nonStackInfo(infoScalarPtr)) + verifyGCInfo(t, "stack PtrScalar", new(PtrScalar), nonStackInfo(infoPtrScalar)) + verifyGCInfo(t, "stack BigStruct", new(BigStruct), nonStackInfo(infoBigStruct())) + verifyGCInfo(t, "stack string", new(string), nonStackInfo(infoString)) + verifyGCInfo(t, "stack slice", new([]string), nonStackInfo(infoSlice)) + verifyGCInfo(t, "stack eface", new(interface{}), nonStackInfo(infoEface)) + verifyGCInfo(t, "stack iface", new(Iface), nonStackInfo(infoIface)) for i := 0; i < 10; i++ { verifyGCInfo(t, "heap ScalarPtr", escape(new(ScalarPtr)), infoScalarPtr) |