diff options
author | ncteisen <ncteisen@gmail.com> | 2017-03-13 11:33:05 -0700 |
---|---|---|
committer | ncteisen <ncteisen@gmail.com> | 2017-03-13 15:06:24 -0700 |
commit | 547cbb229e3630d9b500fd576c2d6a7ad463ba10 (patch) | |
tree | c0577463a69fe1a6d4e0665bed3b90bc773e3f9e /src/core/lib/iomgr/error_internal.h | |
parent | 5398a9696398917090619f95530df7f4acaadba6 (diff) |
Code health and comments
Diffstat (limited to 'src/core/lib/iomgr/error_internal.h')
-rw-r--r-- | src/core/lib/iomgr/error_internal.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/core/lib/iomgr/error_internal.h b/src/core/lib/iomgr/error_internal.h index 0718d31f23..7f204df1b2 100644 --- a/src/core/lib/iomgr/error_internal.h +++ b/src/core/lib/iomgr/error_internal.h @@ -46,14 +46,25 @@ struct grpc_linked_error { uint8_t next; }; +// c core representation of an error. See error.h for high level description of +// this object. struct grpc_error { - gpr_refcount refs; - gpr_atm error_string; + // All atomics in grpc_error must be stored in this nested struct. The rest of + // the object is memcpy-ed in bulk in copy_and_unref. + struct atomics { + gpr_refcount refs; + gpr_atm error_string; + } atomics; + // These arrays index into dynamic arena at the bottom of the struct. + // UINT8_MAX is used as a sentinel value. uint8_t ints[GRPC_ERROR_INT_MAX]; uint8_t strs[GRPC_ERROR_STR_MAX]; uint8_t times[GRPC_ERROR_TIME_MAX]; + // The child errors are stored in the arena, but are effectively a linked list + // structure, since they are contained withing grpc_linked_error objects. uint8_t first_err; uint8_t last_err; + // The arena is dynamically reallocated with a grow factor of 1.5. uint8_t arena_size; uint8_t arena_capacity; intptr_t arena[0]; |