You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/wgengine
Nick Khyl da9965d51c cmd/viewer,types/views,various: avoid allocations in pointer field getters whenever possible
In this PR, we add a generic views.ValuePointer type that can be used as a view for pointers
to basic types and struct types that do not require deep cloning and do not have corresponding
view types. Its Get/GetOk methods return stack-allocated shallow copies of the underlying value.

We then update the cmd/viewer codegen to produce getters that return either concrete views
when available or ValuePointer views when not, for pointer fields in generated view types.
This allows us to avoid unnecessary allocations compared to returning pointers to newly
allocated shallow copies.

Updates #14570

Signed-off-by: Nick Khyl <nickk@tailscale.com>
11 months ago
..
bench ipn/ipnlocal, all: plumb health trackers in tests 2 years ago
capture wgengine/capture: fix v6 field typo in wireshark dissector 1 year ago
filter Fix various linting, vet & static check issues 12 months ago
magicsock util/uniq,types/lazy,*: delete code that's now in Go std 12 months ago
netlog wgengine: add exit destination logging enable for wgengine logger (#11952) 2 years ago
netstack Fix various linting, vet & static check issues 12 months ago
router wgengine/router: refactor udm-pro into broader ubnt support 12 months ago
wgcfg cmd/viewer,types/views,various: avoid allocations in pointer field getters whenever possible 11 months ago
wgint wgengine{,/wgint}: add wgint.Peer wrapper type, add to wgengine.Engine 2 years ago
wglog all: use Go 1.22 range-over-int 2 years ago
winnet all: add test for package comments, fix, add comments as needed 1 year ago
mem_ios.go all: update copyright and license headers 3 years ago
pendopen.go cmd/viewer,types/views,various: avoid allocations in pointer field getters whenever possible 11 months ago
userspace.go all: use iterators over slice views more 1 year ago
userspace_ext_test.go util/usermetrics: make usermetrics non-global 1 year ago
userspace_test.go util/usermetrics: make usermetrics non-global 1 year ago
watchdog.go ipn/ipnlocal,net/tstun,wgengine: create and plumb jailed packet filter 2 years ago
watchdog_js.go all: update copyright and license headers 3 years ago
watchdog_test.go util/usermetrics: make usermetrics non-global 1 year ago
wgengine.go all: add test for package comments, fix, add comments as needed 1 year ago