diff options
author | 2017-12-19 15:20:15 -0800 | |
---|---|---|
committer | 2017-12-19 15:20:15 -0800 | |
commit | 77346746aa69920dc949e201d56c0f11192eaa31 (patch) | |
tree | 32ffa1fe3a9d114a12874a080bdb2f76d0ff2ed2 /src | |
parent | 1acca45e8984acdae4bc782de7186e981dd39443 (diff) |
Add ownership semantic comments to error.h
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lib/iomgr/error.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h index 4759ee0791..8c72a439f6 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -165,6 +165,8 @@ void grpc_error_unref(grpc_error* err); grpc_error* grpc_error_set_int(grpc_error* src, grpc_error_ints which, intptr_t value) GRPC_MUST_USE_RESULT; bool grpc_error_get_int(grpc_error* error, grpc_error_ints which, intptr_t* p); +/// This call takes ownership of the slice; the error is responsible for +/// eventually unref-ing it. grpc_error* grpc_error_set_str(grpc_error* src, grpc_error_strs which, grpc_slice str) GRPC_MUST_USE_RESULT; /// Returns false if the specified string is not set. @@ -174,7 +176,8 @@ bool grpc_error_get_str(grpc_error* error, grpc_error_strs which, /// Add a child error: an error that is believed to have contributed to this /// error occurring. Allows root causing high level errors from lower level -/// errors that contributed to them. +/// errors that contributed to them. The src error takes ownership of the +/// child error. grpc_error* grpc_error_add_child(grpc_error* src, grpc_error* child) GRPC_MUST_USE_RESULT; grpc_error* grpc_os_error(const char* file, int line, int err, |