Author: Stan Eisenstat
Subject: Re: [Cs223] Memory Leak on abort (control C)
Date: Friday, 17 Apr 2020, 08:02:17
> Message Posted By: Unknown
>
> Is there a way to free memory that you malloc when you insert triples into
> the hash table when you abort the program during an infinite loop? In the
> staff solution, for example, when I run ./Nine20 5 5 1000000
> 123456789abcdefghijklmno- abdj-87lm9nce23o41f56ghik and quit the program
> with Control C, there is no memory lost. Everything is still reachable.
> Any suggestions on how to deal with memory loss in this case?
With respect to valgrind, killing a program with CTRL-C
is equivalent to calling exit() at that point in its
execution. Since Hwk5/Nine20 does not leak memory,
valgrind reports that all storage is still reachable.
The same would be true for your program.
--Stan-
PREV
INDEX
NEXT