mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 06:48:17 +00:00
eval/typval: Log list actions
New logging is guarded by cmake LOG_LIST_ACTIONS define. To make it more efficient it is allocated as a linked list with chunks of length 2^(7+chunk_num); that uses basically the same idea as behind increasing kvec length (make appending O(1) (amortized)), but reduces constant by not bothering to move memory around what realloc() would surely do: it is not like we need random access to log entries here to justify usage of a single continuous memory block.
This commit is contained in:
@@ -16665,6 +16665,18 @@ static void f_test_garbagecollect_now(typval_T *argvars,
|
||||
garbage_collect(true);
|
||||
}
|
||||
|
||||
// "test_write_list_log()" function
|
||||
static void f_test_write_list_log(typval_T *const argvars,
|
||||
typval_T *const rettv,
|
||||
FunPtr fptr)
|
||||
{
|
||||
const char *const fname = tv_get_string_chk(&argvars[0]);
|
||||
if (fname == NULL) {
|
||||
return;
|
||||
}
|
||||
list_write_log(fname);
|
||||
}
|
||||
|
||||
bool callback_from_typval(Callback *const callback, typval_T *const arg)
|
||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
{
|
||||
|
Reference in New Issue
Block a user