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/tailcfg
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
..
c2ntypes.go ipn/ipnlocal: add VIPServices hash to return body of vip-services c2n endpoint 11 months ago
derpmap.go all: make more tests pass/skip in airplane mode 2 years ago
proto_port_range.go tailcfg: implement text encoding for ProtoPortRange 2 years ago
proto_port_range_test.go tailcfg: implement text encoding for ProtoPortRange 2 years ago
tailcfg.go tailcfg: remove unused User fields 11 months ago
tailcfg_clone.go tailcfg: remove unused User fields 11 months ago
tailcfg_test.go tailcfg: remove unused User fields 11 months ago
tailcfg_view.go cmd/viewer,types/views,various: avoid allocations in pointer field getters whenever possible 11 months ago
tka.go tailcfg: add RPC structs for /tka/affected-sigs 3 years ago