Luis Carvalho wrote:

> > The patch causes crash.
> > 
> > :lua x = vim.dict()
> > 
> > :let x = luaeval("x")
> > :unlet x
> > :call garbagecollect()
> > :" waste memory to reuse memory used for x ...
> > :for i in range(9999) | let foo = repeat('foo', 9999) | endfor
> > 
> > :lua print(x.abc)
> > crash...
> > 
> > 
> > dict->dv_refcount++ doesn't guard object from garbagecollect.
> 
> Many thanks for the report. Now I know what these {l,d}v_copyID were for... :)
> Please check attached patch. There's another change: I had to make the cache
> table a weak-valued table again, otherwise there would be no way that lists
> and dicts would get collected in Lua.
> 
> Any feedback is, again, appreciated -- especially bug reports!

Now that we know what might go wrong, how about writing a few tests?
That makes sure the problems won't come back.
See testdir/test70.in for the mzscheme tests.


-- 
ARTHUR: Old woman!
DENNIS: Man!
ARTHUR: Man.  I'm sorry.  Old man, What knight live in that castle over there?
DENNIS: I'm thirty-seven.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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

Raspunde prin e-mail lui