chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Re: let-location


From: Nico Amtsberg
Subject: Re: [Chicken-users] Re: let-location
Date: Fri, 16 Jun 2006 13:19:10 +0200
User-agent: Mutt/1.5.11

On Fri, Jun 16, 2006 at 12:44:54PM +0200, felix winkelmann wrote:
> On 6/16/06, Nico Amtsberg <address@hidden> wrote:
> > the program fails with an
> >assertion in runtime.c line 3278 which seems to be the source of the bug if
> >I got your debugging story right.
> 
> OH, DAMMIT! And I was so bloody proud! ;-)
> 
> Attached is the test program. Can you send me your test program again,,
> please?

It is attached at the end. As a hint:
I compared this sample program to the one Kon posted.
The difference that counts is the initialisation of the locations with
any value. If I do not initilialise like this
(let-location ((o0 long) ...
the program fails, but with (let-location ((o0 long 0) ...
it seems to run infinitely.
Same with the sample of Kon.

I tensly look forward to your answer.

Nico

(declare (usual-integrations))
(require-extension srfi-1)
#>
long fill_10(long i, long *o0, long *o1, long *o2, long *o3, long *o4,
                     long *o5, long *o6, long *o7, long *o8, long *o9)
{
 *o0=*o1=*o2=*o3=*o4=*o5=*o6=*o7=*o8=*o9=i;
 return i;
}
<#

(define fill-10!
  (foreign-lambda long "fill_10" long 
                  (c-pointer long) (c-pointer long) (c-pointer long)
                  (c-pointer long) (c-pointer long) (c-pointer long)
                  (c-pointer long) (c-pointer long) (c-pointer long)
                  (c-pointer long)))

(let* ((el 1)
       (expected (make-list 10 el)))
  (let loop
      ()
    ;(gc #f)
    ; this does not work 
    (let-location ((o0 long) (o1 long) (o2 long) (o3 long) (o4 long)
                   (o5 long) (o6 long) (o7 long) (o8 long) (o9 long))
   ; this seems to work                  
   ;(let-location ((o0 long 0) (o1 long 0) (o2 long 0) (o3 long 0) (o4 long 0)
   ;               (o5 long 0) (o6 long 0) (o7 long 0) (o8 long 0) (o9 long 0))
       (fill-10! el
                 (location o0) (location o1) (location o2) (location o3)
                 (location o4) (location o5) (location o6) (location o7)
                 (location o8) (location o9))
       (let ((result (list o0 o1 o2 o3 o4 o5 o6 o7 o8 o9)))
         (if (not (equal? result expected))
             (error "strange values: " result)
             (loop))))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]