@@ -714,7 +714,6 @@ local_processor_result_computation_task<TS, TI, TR>::perform ()
714714{
715715 mp_cell_contexts->compute_results (*mp_contexts, mp_cell, mp_op, m_output_layers, mp_proc);
716716
717- // erase the contexts we don't need any longer
718717 {
719718 tl::MutexLocker locker (& mp_contexts->lock ());
720719
@@ -734,7 +733,10 @@ local_processor_result_computation_task<TS, TI, TR>::perform ()
734733 }
735734#endif
736735
737- mp_contexts->context_map ().erase (mp_cell);
736+ // release some memory
737+ auto ctx = mp_contexts->context_map ().find (mp_cell);
738+ tl_assert (ctx != mp_contexts->context_map ().end ());
739+ ctx->second .cleanup ();
738740 }
739741}
740742
@@ -881,15 +883,6 @@ void local_processor<TS, TI, TR>::run (local_operation<TS, TI, TR> *op, unsigned
881883 compute_results (contexts, op, output_layers);
882884}
883885
884- template <class TS , class TI , class TR >
885- void local_processor<TS, TI, TR>::push_results (db::Cell *cell, unsigned int output_layer, const std::unordered_set<TR> &result) const
886- {
887- if (! result.empty ()) {
888- tl::MutexLocker locker (&cell->layout ()->lock ());
889- cell->shapes (output_layer).insert (result.begin (), result.end ());
890- }
891- }
892-
893886template <class TS , class TI , class TR >
894887void local_processor<TS, TI, TR>::compute_contexts (local_processor_contexts<TS, TI, TR> &contexts, const local_operation<TS, TI, TR> *op, unsigned int subject_layer, const std::vector<unsigned int > &intruder_layers) const
895888{
@@ -1248,7 +1241,7 @@ local_processor<TS, TI, TR>::compute_results (local_processor_contexts<TS, TI, T
12481241 typename local_processor_contexts<TS, TI, TR>::iterator cpc = contexts.context_map ().find (&mp_subject_layout->cell (*bu));
12491242 if (cpc != contexts.context_map ().end ()) {
12501243 cpc->second .compute_results (contexts, cpc->first , op, output_layers, this );
1251- contexts. context_map (). erase (cpc);
1244+ cpc-> second . cleanup (); // release some memory
12521245 }
12531246
12541247 }
@@ -1261,6 +1254,24 @@ local_processor<TS, TI, TR>::compute_results (local_processor_contexts<TS, TI, T
12611254 }
12621255
12631256 }
1257+
1258+ // deliver the results
1259+ {
1260+ tl::MutexLocker locker (& mp_subject_layout->lock ());
1261+ for (auto c = contexts.begin (); c != contexts.end (); ++c) {
1262+
1263+ db::Cell *cell = c->first ;
1264+ auto r = c->second .result ().begin ();
1265+ auto rend = c->second .result ().end ();
1266+
1267+ for (auto o = output_layers.begin (); r != rend && o != output_layers.end (); ++o, ++r) {
1268+ if (! r->empty ()) {
1269+ cell->shapes (*o).insert (r->begin (), r->end ());
1270+ }
1271+ }
1272+
1273+ }
1274+ }
12641275}
12651276
12661277namespace {
0 commit comments