test: 尝试启用xray splice拷贝

This commit is contained in:
wyx2685 committed 2025-08-22 05:22:47 +09:00
1 parent 7d52a8932d
commit 6e8297c553
9 files changed
+473 -454

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
package counter
import (
"sync/atomic"
fstats "github.com/xtls/xray-core/features/stats"
)
var _ fstats.Counter = (*XrayTrafficCounter)(nil)
type XrayTrafficCounter struct {
V *atomic.Int64
}
func (c *XrayTrafficCounter) Value() int64 {
return c.V.Load()
}
func (c *XrayTrafficCounter) Set(newValue int64) int64 {
return c.V.Swap(newValue)
}
func (c *XrayTrafficCounter) Add(delta int64) int64 {
return c.V.Add(delta)
}