Re: [ng-spice] History and command completion


To ng-spice@ieee.ing.uniroma1.it
From widlok <widlok@uci.agh.edu.pl>
Date Sat, 11 Nov 2000 11:00:46 +0100
Delivered-To mailing list ng-spice@ieee.ing.uniroma1.it
Mailing-List contact ng-spice-help@ieee.ing.uniroma1.it; run by ezmlm
References <GDDFCNDEIDKDIAAA@hotbot.com >
Reply-To ng-spice@ieee.ing.uniroma1.it

Hi,

"GLAO S. Dezai" wrote:

> I dont agree, because we cannot free val since we dont know where it has 
>been allocated. We free the result of the cp_unquote after use because we 
>know that the string has been copied and must be freed to avoid the memory 
>leak problem.
>
> Anyway, i am sorry because i didnot test it directly on ngspice.
>

    Yes, You are right about the pointers. Other solution could be to change 
cp_unquote in such way that it will not making a copy of the string but
rather overwriting given string. I am not sure, but I will try to check it.

You wrote (I don't remember where) that the calloc() might cause problems 
with tfree(). I am not sure, but I think that it is not possible. As far as I 
know calloc() uses malloc() inside, but don't take it for sure.

    Regards
            Michael


Partial thread listing: