Switch from pointers to IDs
authorLukáš Jiřiště <gymnazium.jiriste@gmail.com>
Sat, 21 Dec 2024 11:11:47 +0000 (12:11 +0100)
committerLukáš Jiřiště <gymnazium.jiriste@gmail.com>
Sat, 21 Dec 2024 11:18:45 +0000 (12:18 +0100)
commitc5712d126e31837d3bac0ea0023e54cfd39ff088
tree8643b53dc1e74e170ec0720227a07df4a93857ad
parent61c2c3c860d782427db74bdd7aa1e86faa7e47be
Switch from pointers to IDs

Mosfets holding pointers to nodes (and nodes to mosfets) causes problems
when the nodes (or mosfets) vector reallocates. The reallocation
invalidates any pointers.
Holding the ID prevents the invalidation, but may cause performance
issues as the vector needs to be searched for the ID (binary search
would help and is applicable).
The IDs also make the code more networked, because the nodes and mosfets
vectors need to be passed to many more functions.
inc/FET_sim.h
src/build_helper.c
src/c_bind.c
src/c_connect.c
src/c_draw.c
src/colors.c
src/main.c
src/schema_mode.c
src/sim_main.c
src/sim_node.c