mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
don't check refcount in packet buffer's destroy function
The function is only called when refcount is zero, so we don't have to check again. PiperOrigin-RevId: 438171100
This commit is contained in:
committed by
gVisor bot
parent
007a91a911
commit
c2bd153760
@@ -188,9 +188,7 @@ func NewPacketBuffer(opts PacketBufferOptions) *PacketBuffer {
|
||||
// pool.
|
||||
func (pk *PacketBuffer) DecRef() {
|
||||
pk.packetBufferRefs.DecRef(func() {
|
||||
if pk.packetBufferRefs.refCount == 0 {
|
||||
pkPool.Put(pk)
|
||||
}
|
||||
pkPool.Put(pk)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user