ЕО
Size: a a a
ЕО
VS
ЕО
VS
Z
VS
DP
ЕО
VS
ЕО
13 type slice struct {
14 array unsafe.Pointer
15 len int
16 cap int
17 }
VS
Z
VS
ЕО
Z
ЕО
V
type Entities struct {
entities []int
count int64
mu sync.Mutex
}
func (e *Entities) Count() int {
return int(atomic.LoadInt64(&(e.count)))
}
func (e *Entities) Add(entity int) {
e.mu.Lock()
e.entities = append(e.entities, entity)
atomic.AddInt64(&(e.count), 1)
e.mu.Unlock()
}
VS
LT