Skip to content

Commit f9204e9

Browse files
committed
fix: ensure atomic alignment
1 parent c427a15 commit f9204e9

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

item.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ import (
1212
// You must always use the given methods.
1313
type Item[T any] struct {
1414
pool *Pool[T]
15-
cfg any
16-
1715
stat status
16+
// align 64
17+
18+
cfg any
19+
// align 64
1820

1921
val T
2022
}

pbuf/pooler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99

1010
// UserBuffer with customizable user data structure inside.
1111
type UserBuffer[USRDAT any] struct {
12-
bytes.Buffer
1312
DAT USRDAT
13+
bytes.Buffer
1414
}
1515

1616
type bufpooler[USRDAT any] struct{}

pool.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import (
99

1010
// Pool lightweight general pool.
1111
type Pool[T any] struct {
12-
pooler Pooler[T]
13-
pool sync.Pool
1412
countin int32
1513
countout int32
14+
pooler Pooler[T]
15+
pool sync.Pool
1616
noputbak bool
1717
manudstr bool
1818
}

0 commit comments

Comments
 (0)