Re: [ng-spice] History and command completion
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:
- Re: [ng-spice] History and command completion, (continued)
- GLAO S. Dezai