mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 04:07:35 +03:00
introduce a buffer pool for large buffers (20k)
This commit is contained in:
parent
bef0f3d31a
commit
7d8db149b6
5 changed files with 35 additions and 15 deletions
|
@ -9,13 +9,17 @@ import (
|
|||
|
||||
var _ = Describe("Buffer Pool", func() {
|
||||
It("returns buffers of cap", func() {
|
||||
buf := getPacketBuffer()
|
||||
Expect(buf.Data).To(HaveCap(int(protocol.MaxPacketBufferSize)))
|
||||
buf1 := getPacketBuffer()
|
||||
Expect(buf1.Data).To(HaveCap(protocol.MaxPacketBufferSize))
|
||||
buf2 := getLargePacketBuffer()
|
||||
Expect(buf2.Data).To(HaveCap(protocol.MaxLargePacketBufferSize))
|
||||
})
|
||||
|
||||
It("releases buffers", func() {
|
||||
buf := getPacketBuffer()
|
||||
buf.Release()
|
||||
buf1 := getPacketBuffer()
|
||||
buf1.Release()
|
||||
buf2 := getLargePacketBuffer()
|
||||
buf2.Release()
|
||||
})
|
||||
|
||||
It("gets the length", func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue