mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
refactor(api): refactor more api functions to use arena return
Currently having two separate memory strategies for API return values is a bit unnecessary, and mostly a consequence of converting the hot spot cases which needed it first. But there is really no downside to using arena everywhere (which implies also directly using strings which are allocated earlier or even statically, without copy). There only restriction is we need to know the size of arrays in advance, but this info can often be passed on from some earlier stage if it is missing. This collects some "small" cases. The more complex stuff will get a PR each.
This commit is contained in:
@@ -3326,7 +3326,7 @@ void maketitle(void)
|
||||
if (*p_titlestring != NUL) {
|
||||
if (stl_syntax & STL_IN_TITLE) {
|
||||
build_stl_str_hl(curwin, buf, sizeof(buf), p_titlestring,
|
||||
kOptTitlestring, 0, 0, maxlen, NULL, NULL, NULL);
|
||||
kOptTitlestring, 0, 0, maxlen, NULL, NULL, NULL, NULL);
|
||||
title_str = buf;
|
||||
} else {
|
||||
title_str = p_titlestring;
|
||||
@@ -3431,7 +3431,7 @@ void maketitle(void)
|
||||
if (*p_iconstring != NUL) {
|
||||
if (stl_syntax & STL_IN_ICON) {
|
||||
build_stl_str_hl(curwin, icon_str, sizeof(buf), p_iconstring,
|
||||
kOptIconstring, 0, 0, 0, NULL, NULL, NULL);
|
||||
kOptIconstring, 0, 0, 0, NULL, NULL, NULL, NULL);
|
||||
} else {
|
||||
icon_str = p_iconstring;
|
||||
}
|
||||
|
Reference in New Issue
Block a user