Consider the following code:
vim -u NONE --cmd 'let l=[]' --cmd 'call map(range(1024*1024), "extend(g:, {\"l\": [g:l]})")' --cmd 'echo jsonencode(l)'
This crashes with stack full of json_encode_item() calls.
One may be interested in code from neovim/neovim#3365 because it is not using recursion for dumping values.
—
Reply to this email directly or view it on GitHub.![]()
Nikolai Pavlov wrote:
> Consider the following code:
>
> vim -u NONE --cmd 'let l=[]' --cmd 'call map(range(1024*1024), "extend(g:, {\"l\": [g:l]})")' --cmd 'echo jsonencode(l)'
>
> This crashes with stack full of json_encode_item() calls.
>
> One may be interested in code from neovim/neovim#3365 because it is
> not using recursion for dumping values.
The current implementation wasn't really made for large JSON files.
But if someone makes a patch it might get included.
Besides the recursiveness, using the growarray probably also is quite
inefficient. list_join_inner() has a better solution, but it takes
quite a bit of code.
--
hundred-and-one symptoms of being an internet addict:
36. You miss more than five meals a week downloading the latest games from
Apogee.
/// Bram Moolenaar -- Br...@Moolenaar.net -- 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 vim_dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()