gitee.com/sy_183/go-common@v1.0.5-0.20231205030221-958cfe129b47/pool/static-data-pool_test.go (about)

     1  package pool
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestBufPool(t *testing.T) {
     8  	p := NewStaticDataPool(1024, ProvideSlicePool[*Data])
     9  	for i := 0; i < 200000000; i++ {
    10  		d := p.Alloc(1024)
    11  		d.Release()
    12  	}
    13  }