2016-08-19 17:38 GMT+03:00 Nikolay Aleksandrovich Pavlov <[email protected]>:
> 2016-08-19 17:08 GMT+03:00 Yegappan Lakshmanan <[email protected]>:
>> Hi all,
>>
>> On Thu, Aug 18, 2016 at 5:47 AM, Yegappan Lakshmanan
>> <[email protected]> wrote:
>>> Hi all,
>>>
>>> The attached patch adds support for setting and getting a context to/from
>>> a quickfix/location list. There is a refcount problem with this diff (which 
>>> I am
>>> not able to solve).
>>>
>>> If the context is a number or a string, then the patch works without any
>>> issues. If the context is a List or a Dict, then Vim crashes if garbage
>>> collection runs. For example, the following works:
>>>
>>>     :call setqflist([], 'a', {'context':[1,2,3]})
>>>     :echo getqflist({'context':1})
>>>
>>> But the following doesn't work:
>>>
>>>     :call setqflist([], 'a', {'context':[1,2,3]})
>>>     :call garbagecollect()
>>>     :echo getqflist({'context':1})
>>>
>>> Any suggestions on how to copy the context with proper update to the
>>> reference count so that garbage collection doesn't free the List/Dict?
>>
>> Any suggestions on how to fix the reference count issue?
>
> Check garbagecollect() function from eval.c, it is visiting each and

Sorry, it is named `garbage_collect()` (with underscore).

> every place where VimL value may be referenced at the point of next
> main loop cycle start; there exist temporary values which must be
> removed at that point which is fine, your value is saved somewhere and
> not removed, so you must add code there.
>
>>
>> Thanks,
>> Yegappan
>>
>> --
>> --
>> 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].
>> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui