Commit Graph

382 Commits

Author SHA1 Message Date
dwarning edb42b526d Add comment for better understanding. 2018-12-17 23:00:54 +01:00
dwarning 390d0bddd9 Dereferencing of the null pointer 'p' might take place. Remove unused variable. 2018-12-17 22:58:30 +01:00
Holger Vogt 96f3b7b029 bug 380, fix removal of string vector after setting the model parameters 2018-11-18 16:07:26 +01:00
Holger Vogt 34f0e98080 plug a memory leak, delete 'element', if tmalloced before 2018-11-18 16:05:32 +01:00
Holger Vogt 0d9d228c11 Put the copy for generating permanent next_token exactly at the places
where is is needed: INPtermInsert() and fast->conn...->neg_node_str
XSPICE memory leaks are gone!
2018-11-18 15:59:54 +01:00
Holger Vogt 2a6212f77e Add a function gc_start to reset the garbage collector 2018-11-18 15:59:44 +01:00
Holger Vogt 4e6de9626e ** A local garbage collector **
Add the list of malloced addresses alltokens.
Add a function copy_gc to copy and enter the address.
Add a function gc_end to delete all entries in alltokens.
   Beware of addresses deleted elsewhere and use anew by malloc.
Some tokens should not be deleted here, they get another copying.
2018-11-18 15:59:34 +01:00
Holger Vogt fb1970e25a add gc functions to replace MIFgettok and MIFget_token 2018-11-18 15:59:15 +01:00
Holger Vogt ccb7fa410b remove all instances of tfree.
Code is working, but full of memory leaks.
2018-11-18 15:59:05 +01:00
Holger Vogt f9c956ff6b mif_inp2.c, improve on memory leaks
Delete token before generating it anew, delete def_port_str
only if not already done before.
Still there are some tiny leaks left.
2018-11-18 15:58:26 +01:00
Holger Vogt 7b57800df6 bug 378 put tfree(def_port_type_str) to an appropriate place. 2018-11-18 15:57:35 +01:00
dwarning d7089adcaf Also in case of allocation error we have to free existing memory before return. 2018-11-18 15:56:37 +01:00
dwarning a6fa3aaa11 The 'then' statement was equivalent to the 'else' statement.
Also moredimensional poly sources need only one closing bracket for input port.
2018-11-18 15:56:26 +01:00
Holger Vogt 4738edeab5 symbol visibility=hidden only in release mode
for shared library and codemodels
2018-10-27 11:06:16 +02:00
Holger Vogt 45e269819e fix a bug 2018-10-17 19:01:59 +02:00
dwarning 56bc8af358 calloc needs stdlib.h 2018-10-15 22:36:01 +02:00
Holger Vogt 0b7c291f37 replace Id by Idd.
Use Revilimit instead of Ilimit.
Correct for current limits.
2018-10-13 18:19:53 +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
Holger Vogt a17de08b5c free only value that have been TMALLOCed or TREALLOCed 2018-09-26 18:47:06 +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 40e69ceaf4 plug a memory leak after (internal) call to altermod 2018-09-02 18:05:22 +02:00
Holger Vogt 8b02c31326 prevent reading beyond array boundaries 2018-09-02 18:04:00 +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 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 c4f8a02eb0 add a callback to de-allocate the static variable p->element 2018-08-27 17:00:10 +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 9cd9bf345c mif_inp2.c: remove a memory leak 2018-08-26 19:02:21 +02:00
Holger Vogt b1f956f81c fix a memory leak 2018-08-18 11:27:14 +02:00
Holger Vogt d8352342a8 free more data allocated during INIT 2018-08-11 11:37:19 +02:00
Holger Vogt c891c2f64f Update to callback function:
delete memory also in the eno structure
do not close a file twice
2018-08-11 00:43:54 +02:00
Holger Vogt d26d1b96ec add callback function to delete the memory
allocated in the code model
2018-08-10 23:35:33 +02:00
Holger Vogt 9d36a2e326 remove unused i 2018-08-10 23:34:27 +02:00
Holger Vogt 2ce4c1592b a tiny memory leak 2018-08-10 22:03:02 +02:00
Holger Vogt 0bc1d8147c plug a memory leak 2018-08-10 19:56:26 +02:00
Holger Vogt a6f525f6c1 fix a memory leak 2018-08-09 23:23:18 +02:00
Holger Vogt 9db2bf3d69 fix a memory leak 2018-08-09 20:22:33 +02:00
Holger Vogt eab5615fb3 examples moved to examples/xspice/original-examples 2018-07-28 13:47:23 +02:00
Holger Vogt 908339359a clarify start time generation
clarify time and amplitude updates
don't read comment lines
2018-07-26 20:50:36 +02:00
Holger Vogt d1761f8d6e read the complete input file at once during inizialization
instaed of reading the file line by line,
and instaed of re-reading from the beginning in case
of time stepping back. This saves a vast amount of
simulation time if the input file is large.
2018-07-24 22:30:40 +02:00
Holger Vogt 824ac4fbc9 make functions static or add function prototypes 2018-07-21 23:56:14 +02:00
Holger Vogt 42a86d0ff2 patch provided by Uros Platise: timeunit selection
for printing vcd file is now based on tstep instead of tstop
2018-05-26 15:00:37 +02:00
h_vogt 7198056a41 patch no. 16 by Thomy add a function cm_get_circuit to allow accessing the circuit structure ckt from within an XSPICE code model. This is a change to the interface and requires recopiling all code models! 2018-05-19 17:37:42 +02:00
h_vogt 11bafd70ea update to callback functions SendEvtData, SendInitEvtData 2018-05-19 16:46:16 +02:00
h_vogt c890435383 clarify pointers to data structures for event nodes 2018-05-19 16:44:57 +02:00
h_vogt b5f31ec2b1 version conflict rersolved in sharedspice.c 2018-05-19 16:44:46 +02:00
h_vogt 25a324ba6e add parameter mode to EVTsharedsend_line()
last entry for the dictionary list is NULL
2018-05-19 16:44:27 +02:00