• Diogo Pinela's avatar
    sync: make WaitGroup more space-efficient · 9ff7df00
    Diogo Pinela authored
    The struct stores its 64-bit state field in a 12-byte array to
    ensure that it can be 64-bit-aligned. This leaves 4 spare bytes,
    which we can reuse to store the sema field.
    
    (32-bit alignment is still guaranteed because the array type was
    changed to [3]uint32.)
    
    Fixes #19149.
    
    Change-Id: I9bc20e69e45e0e07fbf496080f3650e8be0d6e8d
    Reviewed-on: https://go-review.googlesource.com/100515Reviewed-by: 's avatarDmitry Vyukov <dvyukov@google.com>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    9ff7df00
Name
Last commit
Last update
..
atomic Loading commit data...
cond.go Loading commit data...
cond_test.go Loading commit data...
example_pool_test.go Loading commit data...
example_test.go Loading commit data...
export_test.go Loading commit data...
map.go Loading commit data...
map_bench_test.go Loading commit data...
map_reference_test.go Loading commit data...
map_test.go Loading commit data...
mutex.go Loading commit data...
mutex_test.go Loading commit data...
once.go Loading commit data...
once_test.go Loading commit data...
pool.go Loading commit data...
pool_test.go Loading commit data...
runtime.go Loading commit data...
runtime_sema_test.go Loading commit data...
rwmutex.go Loading commit data...
rwmutex_test.go Loading commit data...
waitgroup.go Loading commit data...
waitgroup_test.go Loading commit data...