Re: Multiple Values and GC

Joseph Donaldson <[email protected]> Fri, 10 Sep 2021 15:48:50 +0000 (UTC)
Newsgroups gmane.lisp.scheme.bigloo
Message-ID <[email protected]>
 Hello, Manuel, 

Have you had a chance to look into my observations about multiple value support in Bigloo (below)? I would appreciate a fix being included in the next version of Bigloo. 

Thank You,Joseph Donaldson

    On Wednesday, May 19, 2021, 09:22:56 AM PDT, Joseph Donaldson <[email protected]> wrote:  
 
 Hello, Manuel,
I recently wrote some code using Bigloo's support for multiple values and discovered that there is an issue with call-with-values that results in incorrect results for some nested invocations. For example, 

(call-with-values (lambda ()
                   (call-with-values (lambda () (values 1 2 3))
                                     +))
                   list)
currently returns (6 2 3) instead of (6). I submitted a small pull request that I believe corrects this, but after looking a bit more at the implementation of multiple values support in Bigloo, I suspect we have a potential memory leak if the only reference to a value is in one of the multiple-values slots that was previously used. Am I missing something that prevents this from happening? If not, should we set the slots to unspecified once the values are retrieve inĀ $get-mvalues-val?
Thank You,Joseph Donaldson