mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-04-24 06:02:37 +00:00
proto: document reset memory aliasing guarantees
Change-Id: I2dc79c362278b6bc9ccf531067701cba5c392a50 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/219141 Reviewed-by: Damien Neil <dneil@google.com>
This commit is contained in:
parent
25fc6fb4f2
commit
e76af4be5e
@ -7,8 +7,9 @@ package proto
|
||||
import "google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
// Reset clears every field in the message.
|
||||
// The resulting message shares no observable memory with its previous state
|
||||
// other than the memory for the message itself.
|
||||
func Reset(m Message) {
|
||||
// TODO(blocks): Document memory aliasing guarantees.
|
||||
if mr, ok := m.(interface{ Reset() }); ok && hasProtoMethods {
|
||||
mr.Reset()
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user