mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2024-12-29 12:17:48 +00:00
c5060d2fe6
Passing a non-pointer type to protoreflect.NewValue causes an unnecessary allocation in order to store the value in an interface{}. While this allocation could be avoided by a smarter compiler, no such compiler exists today. Add functions for creating new values of a specific type, avoiding the allocation. (And also adding a small amount of type safety, although this is unlikely to be important.) Update the proto and internal/impl packages to use these functions. Change-Id: Ic733de22ddf19c530189166c853348e1b54b7391 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/191457 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> |
||
---|---|---|
.. | ||
bench_test.go | ||
decode_gen.go | ||
decode_test.go | ||
decode.go | ||
doc.go | ||
encode_gen.go | ||
encode_test.go | ||
encode.go | ||
equal_test.go | ||
equal.go | ||
extension_test.go | ||
extension.go | ||
isinit_test.go | ||
isinit.go | ||
merge_test.go | ||
merge.go | ||
messageset_test.go | ||
messageset.go | ||
proto_methods.go | ||
proto_reflect.go | ||
proto.go | ||
reset_test.go | ||
reset.go | ||
size_gen.go | ||
size.go | ||
wrappers.go |