From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E58D745C308 for ; Sat, 5 Dec 2020 21:30:29 +0300 (MSK) References: <20201204153003.175555-1-gorcunov@gmail.com> <20201204153003.175555-2-gorcunov@gmail.com> From: Vladislav Shpilevoy Message-ID: <6ba34f0c-8ce5-75ae-2dd7-19e22432e744@tarantool.org> Date: Sat, 5 Dec 2020 19:30:28 +0100 MIME-Version: 1.0 In-Reply-To: <20201204153003.175555-2-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v3 1/4] backtrace: allow to specify destination buffer List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov , tml Cc: Mons Anderson 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 > --- > 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.