[Top][All Lists]

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

[Chicken-users] news from the valgrind front

From: Jörg F . Wittenberger
Subject: [Chicken-users] news from the valgrind front
Date: 07 Oct 2011 18:47:47 +0200

I ran into another valgrind message.

This one comes up *only* if -:g is given (that is gc_report_flag == 1), and only if we come to


by "goto".

In that case the variable "cont" might be not initialized,
and valgrind complains as it should.

So far it looks as if setting "count" to (whatever actually,
it's going to be effective under gc_report_flag only anyway)
value makes the warning go away.

I choose to copy the statement from major gc.  But that's a wild
guess at the end of the day.

Since I have no idea whether or not the value is correct,
I'm not attaching a buggy diff here.

The relevant lines from runtime.c/C_reclaim

   if(gc_mode == GC_REALLOC) {
     C_rereclaim2(percentage(heap_size, C_heap_growth), 0);
     gc_mode = GC_MAJOR;
     count = (C_uword)tospace_top - (C_uword)tospace_start;
     goto never_mind_edsgar;

The line

     count = (C_uword)tospace_top - (C_uword)tospace_start;

would be new.  But if my guess was wrong, then the value given
to count would be wrong.

The important part: assign somthing to count.

In that case for valgrinds sake.  (Which so far looks quite good
as a memory debugger.)

Best regards


reply via email to

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