This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go patch committed: Add go:notinheap magic comment


This patch to the Go frontend implements go:notinheap as the gc
compiler does. A type marked as go:notinheap may not live in the heap,
and does not require a write barrier. Struct and array types that
incorporate notinheap types are themselves notinheap. Allocating a
value of a notinheap type on the heap is an error.

This is not just an optimization. There is code where a write barrier
may not occur that was getting a write barrier with gccgo but not gc,
because the types in question were notinheap. The case I found was
setting the mcache field in exitsyscallfast.

Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

Ian

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]