优化代码

This commit is contained in:
刘祥超
2024-03-28 17:17:34 +08:00
parent f119690ab7
commit f1d0984031
27 changed files with 52 additions and 63 deletions

View File

@@ -3,8 +3,8 @@
package counters
import (
"github.com/TeaOSLab/EdgeNode/internal/utils"
"github.com/TeaOSLab/EdgeNode/internal/utils/fasttime"
memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem"
syncutils "github.com/TeaOSLab/EdgeNode/internal/utils/sync"
"github.com/cespare/xxhash"
"sync"
@@ -31,7 +31,7 @@ type Counter[T SupportedUIntType] struct {
// NewCounter create new counter
func NewCounter[T SupportedUIntType]() *Counter[T] {
var count = utils.SystemMemoryGB() * 8
var count = memutils.SystemMemoryGB() * 8
if count < 8 {
count = 8
}