需要解决方案以最小化内存分配

I have the following code, the flush func below uses 1 allocation per call which copies all data and returns. Are there any other more performant solutions resulting in less garbage collection and fewer CPU cycles?

Can we use sync.Pool here? If so then how? Event slice could be up to 10k elements.

type collector struct {
    sync.Mutex
    count int
    events []*event 
}

type event struct {
    name string
}

func New() *collector {
    return &collector{
        count: 0,
        event: make([]*event,10000),
}

func (c *collector) add(e *event) {
    c.Lock()
    defer c.Unlock()
    c.events[c.count + 1] = e
    c.count++
}

func (c *collector) flush() []*event{
    c.Lock()
    defer c.Unlock()
    result := make([]*event, c.count)
    copy(result, c.events)
    c.count = 0
    return result
}