WIP: Functions: new local allocator for better memory reuse and performance #104630
|
@ -268,10 +268,12 @@ class Executor {
|
|||
BLI_task_pool_free(task_pool);
|
||||
}
|
||||
threading::parallel_for(node_states_.index_range(), 1024, [&](const IndexRange range) {
|
||||
LocalPool<> &local = pools.pools->local();
|
||||
for (const int node_index : range) {
|
||||
const Node &node = *self_.graph_.nodes()[node_index];
|
||||
NodeState &node_state = *node_states_[node_index];
|
||||
this->destruct_node_state(node, node_state, pools);
|
||||
Pools sub_pools = {pools.pools, &local};
|
||||
this->destruct_node_state(node, node_state, sub_pools);
|
||||
}
|
||||
});
|
||||
this->~Executor();
|
||||
|
|
|
@ -701,6 +701,7 @@ class LazyFunctionForGroupNode : public LazyFunction {
|
|||
Storage *s = static_cast<Storage *>(storage);
|
||||
graph_executor_->destruct_storage(s->graph_executor_storage, pools);
|
||||
std::destroy_at(s);
|
||||
pools.local->deallocate(storage, sizeof(Storage), alignof(Storage));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue