Patch 8.2.1084
Problem: Lua: registering function has useless code.
Solution: Remove clearing grow arrays.
Files: src/userfunc.c
*** ../vim-8.2.1083/src/userfunc.c 2020-06-28 18:43:36.296992324 +0200
--- src/userfunc.c 2020-06-29 20:20:12.675975886 +0200
***************
*** 350,365 ****
register_cfunc(cfunc_T cb, cfunc_free_T cb_free, void *state)
{
char_u *name = get_lambda_name();
! ufunc_T *fp = NULL;
! garray_T newargs;
! garray_T newlines;
!
! ga_init(&newargs);
! ga_init(&newlines);
fp = alloc_clear(offsetof(ufunc_T, uf_name) + STRLEN(name) + 1);
if (fp == NULL)
! goto errret;
fp->uf_dfunc_idx = UF_NOT_COMPILED;
fp->uf_refcount = 1;
--- 350,360 ----
register_cfunc(cfunc_T cb, cfunc_free_T cb_free, void *state)
{
char_u *name = get_lambda_name();
! ufunc_T *fp;
fp = alloc_clear(offsetof(ufunc_T, uf_name) + STRLEN(name) + 1);
if (fp == NULL)
! return NULL;
fp->uf_dfunc_idx = UF_NOT_COMPILED;
fp->uf_refcount = 1;
***************
*** 367,374 ****
fp->uf_flags = FC_CFUNC;
fp->uf_calls = 0;
fp->uf_script_ctx = current_sctx;
- fp->uf_lines = newlines;
- fp->uf_args = newargs;
fp->uf_cb = cb;
fp->uf_cb_free = cb_free;
fp->uf_cb_state = state;
--- 362,367 ----
***************
*** 377,388 ****
hash_add(&func_hashtab, UF2HIKEY(fp));
return name;
-
- errret:
- ga_clear_strings(&newargs);
- ga_clear_strings(&newlines);
- vim_free(fp);
- return NULL;
}
#endif
--- 370,375 ----
*** ../vim-8.2.1083/src/version.c 2020-06-29 20:09:33.266762870 +0200
--- src/version.c 2020-06-29 20:19:43.608119318 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1084,
/**/
--
The chat program is in public domain. This is not the GNU public license.
If it breaks then you get to keep both pieces.
-- Copyright notice for the chat program
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202006291820.05TIKvXf675554%40masaka.moolenaar.net.