aboutsummaryrefslogtreecommitdiffstats
path: root/device/pools.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josh@tailscale.com>2020-12-15 16:00:52 -0800
committerJason A. Donenfeld <Jason@zx2c4.com>2021-01-07 14:49:44 +0100
commitc8faa34cdee37d9bcb588675e2385024bef86c18 (patch)
tree0a228df9a2e2438388918c766577255496aa6e3c /device/pools.go
parentdevice: use channel close to shut down and drain outbound channel (diff)
downloadwireguard-go-c8faa34cdee37d9bcb588675e2385024bef86c18.tar.xz
wireguard-go-c8faa34cdee37d9bcb588675e2385024bef86c18.zip
device: always name *Queue*Element variables elem
They're called elem in most places. Rename a few local variables to make it consistent. This makes it easier to grep the code for things like elem.Drop. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
Diffstat (limited to 'device/pools.go')
-rw-r--r--device/pools.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/device/pools.go b/device/pools.go
index 6939eeb..55eb6ab 100644
--- a/device/pools.go
+++ b/device/pools.go
@@ -64,12 +64,12 @@ func (device *Device) GetInboundElement() *QueueInboundElement {
}
}
-func (device *Device) PutInboundElement(msg *QueueInboundElement) {
- msg.clearPointers()
+func (device *Device) PutInboundElement(elem *QueueInboundElement) {
+ elem.clearPointers()
if PreallocatedBuffersPerPool == 0 {
- device.pool.inboundElementPool.Put(msg)
+ device.pool.inboundElementPool.Put(elem)
} else {
- device.pool.inboundElementReuseChan <- msg
+ device.pool.inboundElementReuseChan <- elem
}
}
@@ -81,11 +81,11 @@ func (device *Device) GetOutboundElement() *QueueOutboundElement {
}
}
-func (device *Device) PutOutboundElement(msg *QueueOutboundElement) {
- msg.clearPointers()
+func (device *Device) PutOutboundElement(elem *QueueOutboundElement) {
+ elem.clearPointers()
if PreallocatedBuffersPerPool == 0 {
- device.pool.outboundElementPool.Put(msg)
+ device.pool.outboundElementPool.Put(elem)
} else {
- device.pool.outboundElementReuseChan <- msg
+ device.pool.outboundElementReuseChan <- elem
}
}