From 1b45cc45e37cfe67733ebff5eb5cabfef207eef6 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 25 Mar 2014 14:11:34 -0700 Subject: runtime: redo stack map entries to avoid false retention Change two-bit stack map entries to encode: 0 = dead 1 = scalar 2 = pointer 3 = multiword If multiword, the two-bit entry for the following word encodes: 0 = string 1 = slice 2 = iface 3 = eface That way, during stack scanning we can check if a string is zero length or a slice has zero capacity. We can avoid following the contained pointer in those cases. It is safe to do so because it can never be dereferenced, and it is desirable to do so because it may cause false retention of the following block in memory. Slice feature turned off until issue 7564 is fixed. Update #7549 LGTM=rsc R=golang-codereviews, bradfitz, rsc CC=golang-codereviews https://golang.org/cl/76380043 --- src/pkg/runtime/runtime.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pkg/runtime/runtime.h') diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h index 9cb6960c62..7bd45d1a24 100644 --- a/src/pkg/runtime/runtime.h +++ b/src/pkg/runtime/runtime.h @@ -578,6 +578,7 @@ struct DebugVars int32 allocfreetrace; int32 efence; int32 gctrace; + int32 gcdead; int32 scheddetail; int32 schedtrace; }; -- cgit v1.3