summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/solver/nld_matrix_solver.cpp
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2019-02-21 22:59:17 +0100
committer couriersud <couriersud@gmx.org>2019-02-22 08:18:01 +0100
commitcf73ccc764d574284bef4ce95ee5bc3e9089f053 (patch)
tree1655c2836b200c90d5fe5dd5833159e7e8be1522 /src/lib/netlist/solver/nld_matrix_solver.cpp
parent6ed352261d40e37887357fe901dc380d6ef79844 (diff)
netlist: memory management. [Couriersud]
Memory management in plib is now alignment-aware. All allocations respect c++11 alignas. Selected classes like parray and aligned_vector also provide hints (__builtin_assume_aligned) to g++ and clang. The alignment optimizations have little impact on the current use cases. They only become effective on bigger data processing. What has a measurable impact is memory pooling. This speeds up netlist games like breakout and pong by about 5%. Tested with linux, macosx and windows cross builds. All features are disabled since I can not rule out they may temporarily break more exotic builds.
Diffstat (limited to 'src/lib/netlist/solver/nld_matrix_solver.cpp')
-rw-r--r--src/lib/netlist/solver/nld_matrix_solver.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/netlist/solver/nld_matrix_solver.cpp b/src/lib/netlist/solver/nld_matrix_solver.cpp
index 36c8f2fb551..951733874fd 100644
--- a/src/lib/netlist/solver/nld_matrix_solver.cpp
+++ b/src/lib/netlist/solver/nld_matrix_solver.cpp
@@ -336,9 +336,9 @@ void matrix_solver_t::setup_matrix()
* This should reduce cache misses ...
*/
- auto **touched = plib::palloc_array<bool *>(iN);
+ auto **touched = plib::pnew_array<bool *>(iN);
for (std::size_t k=0; k<iN; k++)
- touched[k] = plib::palloc_array<bool>(iN);
+ touched[k] = plib::pnew_array<bool>(iN);
for (std::size_t k = 0; k < iN; k++)
{
@@ -397,8 +397,8 @@ void matrix_solver_t::setup_matrix()
}
for (std::size_t k=0; k<iN; k++)
- plib::pfree_array(touched[k]);
- plib::pfree_array(touched);
+ plib::pdelete_array(touched[k]);
+ plib::pdelete_array(touched);
}
void matrix_solver_t::update_inputs()