From 1d4942afe0872e5f6d95cfa0a5751ef4a9dde114 Mon Sep 17 00:00:00 2001 From: Rick Hudson Date: Tue, 19 Jul 2016 14:21:23 -0400 Subject: [dev.garbage] runtime: determine if an object is public ROC (request oriented collector) needs to determine if an object is visible to other goroutines, i.e. public. In a later CL this will be used by the write barrier and the publishing logic to distinguish between local and public objects and act accordingly. Change-Id: I6a80da9deb21f57e831a2ec04e41477f997a8c33 Reviewed-on: https://go-review.googlesource.com/25056 Reviewed-by: Austin Clements --- src/runtime/mheap.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/runtime/mheap.go') diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 4cf08e46a7..09dc0d51ad 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -195,6 +195,13 @@ type mspan struct { // helps performance. nelems uintptr // number of object in the span. + // startindex is the object index where the owner G started allocating in this span. + // + // This is used in conjunction with nextUsedSpan to implement ROC checkpoints and recycles. + startindex uintptr + // nextUsedSpan links together all spans that have the same span class and owner G. + nextUsedSpan *mspan + // Cache of the allocBits at freeindex. allocCache is shifted // such that the lowest bit corresponds to the bit freeindex. // allocCache holds the complement of allocBits, thus allowing -- cgit v1.2.1