runtime: mark tiny blocks at GC start
The hybrid barrier requires allocate-black, but there's one case where we don't currently allocate black: the tiny allocator. If we allocate a *new* tiny alloc block during GC, it will be allocated black, but if we allocated the current block before GC, it won't be black, and the further allocations from it won't mark it, which means we may free a reachable tiny block during sweeping. Fix this by passing over all mcaches at the beginning of mark, while the world is still stopped, and greying their tiny blocks. Updates #17503. Change-Id: I04d4df7cc2f553f8f7b1e4cb0b52e2946588111a Reviewed-on: https://go-review.googlesource.com/31456Reviewed-by: Rick Hudson <rlh@golang.org>
Showing
Please register or sign in to comment