You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Motivation:
`GRPCStatus` is a `class` because it was too wide to fit within the
inline storage of an existential container and would incur unnecessary
heap allocations as a result.
In #942 the implementation of the `GRPCStatus.Code` stored by the status
was changed from an `enum` to a `struct`. As a result, the width of
`GRPCStatus` (as a `struct`) is now 24 and may therefore be stored
inline in an existential container. Unfortunately, this now makes
`_GRPCClientResponsePart` too wide! This can be addressed by further narrowing
the `Code` stored by the status.
Modifications:
- Narrow `GRPCStatus.Code` by storing its `rawValue` internally as a `UInt8`
- Make `GRPCStatus` a `struct` instead of a `class` (note: we already
have a test in place to validate it may be stored inline in an
existential container).
Result:
- `GRPCStatus` only allocates when the `message` isn't `nil`
0 commit comments