[Tarantool-patches] [PATCH] refactoring: drop excess 16Kb bss buffer
Cyrill Gorcunov
gorcunov at gmail.com
Thu Jan 9 23:18:57 MSK 2020
On Thu, Jan 09, 2020 at 11:15:33PM +0300, Cyrill Gorcunov wrote:
...
> > @@ -140,8 +139,9 @@ backtrace()
> > unw_getcontext(&unw_context);
> > unw_cursor_t unw_cur;
> > unw_init_local(&unw_cur, &unw_context);
> > + char *backtrace_buf = (char *)static_alloc(SMALL_STATIC_SIZE);
> > char *p = backtrace_buf;
> > - char *end = p + sizeof(backtrace_buf) - 1;
> > + char *end = p + SMALL_STATIC_SIZE - 1;
> > int unw_status;
> > *p = '\0';
> > while ((unw_status = unw_step(&unw_cur)) > 0) {
>
> static_alloc has all rights to return NULL, thus you better add
> a test at least.
>
> NAK for a while
Surely it should not fail for this exact size such as SMALL_STATIC_SIZE,
still the situation may change at future, so as a minimum we need
some kind of assert(backtrace_buf != NULL);
More information about the Tarantool-patches
mailing list