Commit 1d2955a2 authored by Russ Cox's avatar Russ Cox

runtime: round channel size in allocation instead of using system-specific pad field

Followup to CL 128700043.

LGTM=bradfitz, dvyukov
R=dvyukov, bradfitz
CC=golang-codereviews
https://golang.org/cl/133850043
parent b83d8bd0
......@@ -11,11 +11,11 @@ import "unsafe"
const (
maxAlign = 8
hchanSize = unsafe.Sizeof(hchan{})
hchanSize = unsafe.Sizeof(hchan{}) + uintptr(-int(unsafe.Sizeof(hchan{}))&(maxAlign-1))
debugChan = false
)
// TODO: make hchan.buf an unsafe.Pointer, not a *uint8
// TODO(khr): make hchan.buf an unsafe.Pointer, not a *uint8
func makechan(t *chantype, size int64) *hchan {
elem := t.elem
......
......@@ -21,9 +21,6 @@ struct Hchan
byte* buf;
uint16 elemsize;
uint32 closed;
#ifndef GOARCH_amd64
uint32 pad; // ensures proper alignment of the buffer that follows Hchan in memory
#endif
Type* elemtype; // element type
uintgo sendx; // send index
uintgo recvx; // receive index
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment