1
0
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:
源文雨
2025-04-03 16:41:30 +09:00
parent c427a15a7e
commit f9204e9924
3 changed files with 7 additions and 5 deletions

View File

@@ -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
} }

View File

@@ -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{}

View File

@@ -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
} }