perf(api): allow to use an arena for return values

This commit is contained in:
bfredl
2022-08-23 09:33:08 +02:00
parent baaaa1f2b3
commit c0d6052654
36 changed files with 584 additions and 497 deletions

View File

@@ -1021,7 +1021,7 @@ void nvim_buf_del_var(Buffer buffer, String name, Error *err)
/// @param buffer Buffer handle, or 0 for current buffer
/// @param[out] err Error details, if any
/// @return Buffer name
String nvim_buf_get_name(Buffer buffer, Error *err)
String nvim_buf_get_name(Buffer buffer, Arena *arena, Error *err)
FUNC_API_SINCE(1)
{
String rv = STRING_INIT;
@@ -1031,7 +1031,7 @@ String nvim_buf_get_name(Buffer buffer, Error *err)
return rv;
}
return cstr_to_string((char *)buf->b_ffname);
return cstr_as_string((char *)buf->b_ffname);
}
/// Sets the full file name for a buffer