mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-28 10:32:46 +08:00
rtp改成链表形式
This commit is contained in:
10
util/pool.go
10
util/pool.go
@@ -278,3 +278,13 @@ func (p BytesPool) Get(size int) (item *ListItem[Buffer]) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type Pool[T any] List[T]
|
||||
|
||||
func (p *Pool[T]) Get() (item *ListItem[T]) {
|
||||
item = (*List[T])(p).PoolShift()
|
||||
if item == nil {
|
||||
item = &ListItem[T]{}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user