protobuf-go/internal/impl
Joe Tsai 5d63473da8 internal/impl: add runtime support for *[]byte unknown representation
This CL adds runtime support for unknown fields to be represented
as *[]byte in addition to the current representation as []byte.
This CL does not change generated code to use *[]byte.

Comparison between using *[]byte and []byte:

• Every message supports unknown fields, so use of []byte
  expands a message size by 24B (for 64-bit systems).
  In contrast, *[]byte only expands a message by 8B.
  This has significant memory implications for small messages.

• If unknown fields are encountered, *[]byte has extra overhead
  allocating the 24B slice header. However, it is assumed
  that messages rarely see any unknown fields at runtime,
  or generally do so for a temporary period of time.

Change-Id: I81935e4ea7394166e61ff4579f76f59fa792dfc9
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/244937
Reviewed-by: Damien Neil <dneil@google.com>
2020-07-28 16:36:39 +00:00
..
api_export.go reflect/protoreflect: add MessageFieldTypes 2020-07-23 21:24:58 +00:00
checkinit.go all: rename IsInitialized as CheckInitialized 2020-02-20 20:45:40 +00:00
codec_extension.go internal/impl: remove deprecated ExtensionField methods 2020-03-23 18:37:32 +00:00
codec_field.go internal/impl: make errInvalidUTF8 be a proto.Error 2020-07-24 21:43:34 +00:00
codec_gen.go all: return less-specific, but more informative wire unmarshal errors 2020-07-23 20:09:00 +00:00
codec_map_go111.go
codec_map_go112.go
codec_map.go all: return less-specific, but more informative wire unmarshal errors 2020-07-23 20:09:00 +00:00
codec_message.go internal/impl: add runtime support for *[]byte unknown representation 2020-07-28 16:36:39 +00:00
codec_messageset.go internal/impl: add runtime support for *[]byte unknown representation 2020-07-28 16:36:39 +00:00
codec_reflect.go all: return less-specific, but more informative wire unmarshal errors 2020-07-23 20:09:00 +00:00
codec_tables.go internal/impl: validate UTF-8 for proto3 optional strings 2020-05-01 17:23:32 +00:00
codec_unsafe.go
convert_list.go all: improve extension validation 2020-04-23 06:01:13 +00:00
convert_map.go all: improve extension validation 2020-04-23 06:01:13 +00:00
convert.go all: improve extension validation 2020-04-23 06:01:13 +00:00
decode.go internal/impl: add runtime support for *[]byte unknown representation 2020-07-28 16:36:39 +00:00
encode.go internal/impl: add runtime support for *[]byte unknown representation 2020-07-28 16:36:39 +00:00
enum_test.go
enum.go
extension_test.go all: trivial formatting changes 2020-02-25 21:59:54 +00:00
extension.go
lazy_test.go all: tests, tweaks for lazy extension decoding 2020-02-06 19:43:25 +00:00
legacy_aberrant_test.go internal/impl: handle extremely old messages 2020-04-02 21:12:23 +00:00
legacy_enum.go
legacy_export_test.go
legacy_export.go reflect/protoreflect: add MessageFieldTypes 2020-07-23 21:24:58 +00:00
legacy_extension.go reflect/protoreflect: add FieldDescriptor.TextName 2020-07-08 23:23:57 +00:00
legacy_file_test.go all: trivial formatting changes 2020-02-25 21:59:54 +00:00
legacy_file.go
legacy_message.go internal/impl: rename legacyProtoMethods as aberrantProtoMethods 2020-07-27 20:52:20 +00:00
legacy_test.go all: trivial formatting changes 2020-02-25 21:59:54 +00:00
merge_gen.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
merge.go internal/impl: add runtime support for *[]byte unknown representation 2020-07-28 16:36:39 +00:00
message_reflect_field.go all: improve panic messages for better debugability 2020-05-05 21:10:54 +00:00
message_reflect_gen.go all: improve panic messages for better debugability 2020-05-05 21:10:54 +00:00
message_reflect_test.go internal/impl: add runtime support for *[]byte unknown representation 2020-07-28 16:36:39 +00:00
message_reflect.go internal/impl: add runtime support for *[]byte unknown representation 2020-07-28 16:36:39 +00:00
message.go internal/impl: add runtime support for *[]byte unknown representation 2020-07-28 16:36:39 +00:00
pointer_reflect.go internal/impl: add runtime support for *[]byte unknown representation 2020-07-28 16:36:39 +00:00
pointer_unsafe.go internal/impl: add runtime support for *[]byte unknown representation 2020-07-28 16:36:39 +00:00
validate.go internal/genid: add new package for generated identifiers 2020-05-29 07:08:23 +00:00
weak.go all: use v2 Message interface for weak fields 2020-04-29 22:34:29 +00:00