[Tarantool-patches] [PATCH v3 1/4] backtrace: allow to specify destination buffer
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Sat Dec 5 21:30:28 MSK 2020
Thanks for the patch!
On 04.12.2020 16:30, Cyrill Gorcunov via Tarantool-patches wrote:
> This will allow to reuse this routine in crash
> reports.
>
> Part-of #5261
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
> ---
> src/lib/core/backtrace.cc | 12 ++++++------
> src/lib/core/backtrace.h | 3 +++
> 2 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/src/lib/core/backtrace.cc b/src/lib/core/backtrace.cc
> index 456ce9a4d..68d0d3ee6 100644
> --- a/src/lib/core/backtrace.cc
> +++ b/src/lib/core/backtrace.cc
> @@ -131,7 +131,7 @@ get_proc_name(unw_cursor_t *unw_cur, unw_word_t *offset, bool skip_cache)
> }
>
> char *
> -backtrace(void)
> +backtrace(char *start, char *end)
Why so strange choice of arguments? We almost always use char* + size_t,
except for a few cases such as code working with tuples, where we 'save'
time on not calculating 'end' in each next stack frame. Lets be consistent
and use char* + size_t, not to raise unnecessary questions for such simple
code.
More information about the Tarantool-patches
mailing list