mirror of
https://github.com/fumiama/orbyte.git
synced 2026-06-23 04:30:30 +08:00
fix: ensure atomic alignment
This commit is contained in:
6
item.go
6
item.go
@@ -12,9 +12,11 @@ import (
|
|||||||
// You must always use the given methods.
|
// You must always use the given methods.
|
||||||
type Item[T any] struct {
|
type Item[T any] struct {
|
||||||
pool *Pool[T]
|
pool *Pool[T]
|
||||||
cfg any
|
|
||||||
|
|
||||||
stat status
|
stat status
|
||||||
|
// align 64
|
||||||
|
|
||||||
|
cfg any
|
||||||
|
// align 64
|
||||||
|
|
||||||
val T
|
val T
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
|
|
||||||
// UserBuffer with customizable user data structure inside.
|
// UserBuffer with customizable user data structure inside.
|
||||||
type UserBuffer[USRDAT any] struct {
|
type UserBuffer[USRDAT any] struct {
|
||||||
bytes.Buffer
|
|
||||||
DAT USRDAT
|
DAT USRDAT
|
||||||
|
bytes.Buffer
|
||||||
}
|
}
|
||||||
|
|
||||||
type bufpooler[USRDAT any] struct{}
|
type bufpooler[USRDAT any] struct{}
|
||||||
|
|||||||
4
pool.go
4
pool.go
@@ -9,10 +9,10 @@ import (
|
|||||||
|
|
||||||
// Pool lightweight general pool.
|
// Pool lightweight general pool.
|
||||||
type Pool[T any] struct {
|
type Pool[T any] struct {
|
||||||
pooler Pooler[T]
|
|
||||||
pool sync.Pool
|
|
||||||
countin int32
|
countin int32
|
||||||
countout int32
|
countout int32
|
||||||
|
pooler Pooler[T]
|
||||||
|
pool sync.Pool
|
||||||
noputbak bool
|
noputbak bool
|
||||||
manudstr bool
|
manudstr bool
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user