Commit Graph

5069 Commits

Author SHA1 Message Date
Holger Vogt d636f7899b cp_enqvar() returns freshly malloced variables as well
as variables owned by somebody else, e.g. from ft_curckt->ci_vars.
The new function parameter tbfreed notifies the caller if the
variable is malloced here and may be freed safely.
2018-10-13 18:19:31 +02:00
Holger Vogt 6df684e22a Evaluate .if ... .elsif ... .else ... .endif recursivly 2018-10-13 18:19:21 +02:00
Holger Vogt a22017024b add some info to file header 2018-10-13 18:19:09 +02:00
Holger Vogt faa7ce003c Add a new code model 'sidiode' with a simple diode:
Linear reverse, off, and on regions
Smooth parabolic transition between the regions
Maximum current settings possible with tanh transistion
Current versus voltage continuously differentiable
No diode capacitance
2018-10-13 18:18:59 +02:00
dwarning 76c43ab512 using the native tan and tanh math functions for real vector calculation 2018-10-13 18:18:47 +02:00
dwarning 3dd94ba15c differentiate tan and tanh in safe way without cos and cosh 2018-10-13 18:18:37 +02:00
Holger Vogt f33c3f0751 remove memory leak, when ft_getnames ... free_pnode couple
parses a vector like v(1,2)
2018-10-13 18:18:23 +02:00
Holger Vogt ae89381bb6 Prevent a segfault if multiple circuits are freed upon 'quit'
by checking if a 'recent_deck' that is to be freed also exists
with same address in ci_mcdeck of another circuit. If yes, set
this to NULL before freeing.
2018-09-26 18:47:20 +02:00
Holger Vogt a17de08b5c free only value that have been TMALLOCed or TREALLOCed 2018-09-26 18:47:06 +02:00
Holger Vogt 2a3c88add6 Commit ad0f59657 ("fix a memory leak", 2018-08-13) made
the special device parameter notation @m1[vt0] unusable.
This fix frees only the tokens that are already overridden
in function INPinsertNofree(). The reason for using this
function instead of INPinsert() is not obvious.
2018-09-26 18:46:12 +02:00
Holger Vogt 5f0b2f344e spurious crash: MIFgettok deliveres strings that cannot be freed:
MS Windows, VS or MSYS2/MINGW/GCC, shared ngspice, single character
token at end of line, compiled with optimization, not in debug mode.
Preliminary fix: TMALLOC another byte to token.
Origin of bug still unknown: Source code error? MS library error?
Re-write of MIFgettok does not show this error (so far...).
2018-09-26 18:45:46 +02:00
Holger Vogt 92b69cbc55 prepare ngspice-29 2018-09-26 18:45:35 +02:00
Holger Vogt 40e69ceaf4 plug a memory leak after (internal) call to altermod 2018-09-02 18:05:22 +02:00
Holger Vogt 12c864fb5a destroy the tmalloced diag, if rshunt option was enabled 2018-09-02 18:05:01 +02:00
Holger Vogt 2e9c28c79a Prevent segfault, if mutual inductor coupling
specifies non-existing inductors
2018-09-02 18:04:49 +02:00
Holger Vogt b0e7962169 don't generate error message during transient analysis,
it will not be used
2018-09-02 18:04:42 +02:00
Holger Vogt fc3ffb2e3c free global string errMsg 2018-09-02 18:04:31 +02:00
Holger Vogt 0406546f7e remove a small memoryleak in (nested) goto loops 2018-09-02 18:04:25 +02:00
Holger Vogt 70439e38fa safety check if no circuit is loaded, prevent crash 2018-09-02 18:04:19 +02:00
Holger Vogt 8b02c31326 prevent reading beyond array boundaries 2018-09-02 18:04:00 +02:00
Holger Vogt a8a6e0b2ff During unsetup delete the InstanceArray (only for OpenMP) 2018-08-28 23:15:02 +02:00
Holger Vogt 800c9711f2 add a flag 'type of the union' to safely free model->param[i]->element,
if it contain a malloced string
2018-08-28 21:29:05 +02:00
Holger Vogt f6cbaea604 data[i] is no longer written beyond its allocated length 2018-08-28 18:45:19 +02:00
Holger Vogt 2867678f99 For unsetup de-allocate the memory
that has been allocated locally in the code model during INIT
2018-08-28 17:11:51 +02:00
Holger Vogt 7d12b4897c clean-up function com_quit 2018-08-28 16:24:43 +02:00
dwarning 06d0aaa827 whitespaces 2018-08-28 14:55:43 +02:00
dwarning 06fb917b82 plug a memory leak in bsim models 2018-08-28 14:42:29 +02:00
Holger Vogt fa60f7d21d avoid memory leak in X11 2018-08-27 21:20:19 +02:00
Holger Vogt c4f8a02eb0 add a callback to de-allocate the static variable p->element 2018-08-27 17:00:10 +02:00
Holger Vogt 06df6ca8e7 avoid pre-matuire exit (byemessage not called) 2018-08-27 14:28:04 +02:00
Holger Vogt 80a767f6cd add here->intgr to the de-allocated memory 2018-08-27 14:00:18 +02:00
Holger Vogt 21edfb2127 safety measure against here->conn[i]->port[j]->partial etc.
being NULL
2018-08-27 12:47:56 +02:00
Holger Vogt a5179b1637 free memory allocated in MIFsetup and by cm_analog_alloc and cm_analog_converge 2018-08-27 12:19:24 +02:00
Holger Vogt c87dd6161f mifsetup.c: use astyle to beautify the code for better readability 2018-08-27 10:54:54 +02:00
Holger Vogt e7bcc09bb0 remove memory leak: delete duplicate .param lines 2018-08-27 00:20:52 +02:00
Holger Vogt 9cd9bf345c mif_inp2.c: remove a memory leak 2018-08-26 19:02:21 +02:00
Holger Vogt 3ee1f92d2e plug a memory leak in b3temp.cir: no overwriting of size dependent
model parameters in pParam
FIXME: still to be done for other BSIM models!
2018-08-25 23:14:03 +02:00
Holger Vogt b6b66c71bd plug a small memory leak (switch-oszillators.cir) 2018-08-25 23:12:17 +02:00
Holger Vogt 9332801382 free the original wlist, made by getcommand(),
not a derived wlist that is just part of the original
2018-08-25 00:38:26 +02:00
Holger Vogt c5cea6d6c1 remove ft_curckt->ci_meas upon removing the current circuit ft_curckt 2018-08-24 22:58:02 +02:00
Holger Vogt 5f1f6ccb29 add a small comment 2018-08-24 22:41:14 +02:00
Holger Vogt 0fbe920382 plug a small memory leak in switch-oscillators.cir 2018-08-24 21:56:29 +02:00
Holger Vogt 2b50ca7271 command 'print': preserve case for filenames after redirection '>' 2018-08-24 15:41:53 +02:00
dwarning 5380c3f4da prevent a small memory leak 2018-08-23 15:44:00 +02:00
Holger Vogt 0e0b276a3e ISRC: update to trnoise source, same as in VSRC 2018-08-23 10:56:50 +02:00
Holger Vogt aedd9d92ee upon alter the trnoise or trrandom states get re-written.
so delete the old state first.
2018-08-23 10:13:17 +02:00
Holger Vogt b4c6a7d324 add function trnoise_state_free and use it
instead of its individual components
2018-08-23 10:12:24 +02:00
Holger Vogt c88578e2c5 noise value is 0 for time == zero.
Only when time changes from time == 0 to time > 0,
the 1/f noise data are generated once per voltage instance
with 1/f noise requested.
2018-08-22 22:38:34 +02:00
Holger Vogt d3b7619754 add a flag timezero to trnoise_state
falg is true as long as time = 0. Allows
to detect the change from time == 0 to time > 0
only then the 1/f data may be created anew (e.g.
due to multiple 'run' commands
2018-08-22 22:36:35 +02:00
dwarning aa95da431a adaptive format specifier for size_t printf 2018-08-22 14:19:12 +02:00