diff options
author | Mark D. Roth <roth@google.com> | 2018-06-07 11:09:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-07 11:09:19 -0700 |
commit | 0cdf00839b8188a7e41195d3e40265445a2fd476 (patch) | |
tree | 2fa9473eed5865e51049bba3825d1a53679f62d1 /src/core/lib/transport | |
parent | c09f7432c08704cac122bf4fa65122059c7726db (diff) | |
parent | 16267c1a23b59932ad763cfb96c53098f8fd27b1 (diff) |
Merge pull request #15649 from markdroth/avoid_peer_string_alloc
Avoid allocating the peer string returned from the transport.
Diffstat (limited to 'src/core/lib/transport')
-rw-r--r-- | src/core/lib/transport/transport.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h index 10e9df0f7c..b2e252d939 100644 --- a/src/core/lib/transport/transport.h +++ b/src/core/lib/transport/transport.h @@ -168,13 +168,11 @@ struct grpc_transport_stream_op_batch_payload { /** Iff send_initial_metadata != NULL, flags associated with send_initial_metadata: a bitfield of GRPC_INITIAL_METADATA_xxx */ uint32_t send_initial_metadata_flags; - // If non-NULL, will be set by the transport to the peer string - // (a char*, which the caller takes ownership of). + // If non-NULL, will be set by the transport to the peer string (a char*). + // The transport retains ownership of the string. // Note: This pointer may be used by the transport after the // send_initial_metadata op is completed. It must remain valid // until the call is destroyed. - // Note: When a transport sets this, it must free the previous - // value, if any. gpr_atm* peer_string; } send_initial_metadata; @@ -202,13 +200,11 @@ struct grpc_transport_stream_op_batch_payload { // immediately available. This may be a signal that we received a // Trailers-Only response. bool* trailing_metadata_available; - // If non-NULL, will be set by the transport to the peer string - // (a char*, which the caller takes ownership of). + // If non-NULL, will be set by the transport to the peer string (a char*). + // The transport retains ownership of the string. // Note: This pointer may be used by the transport after the // recv_initial_metadata op is completed. It must remain valid // until the call is destroyed. - // Note: When a transport sets this, it must free the previous - // value, if any. gpr_atm* peer_string; } recv_initial_metadata; |