imnodes icon indicating copy to clipboard operation
imnodes copied to clipboard

Object pool cleanup

Open Nelarius opened this issue 3 years ago • 0 comments

Primary concerns

Iterating over all nodes, both used and unused, seems to cause continuous issues due to the complicated logic in the object pool and free list usage: https://github.com/Nelarius/imnodes/issues/71, https://github.com/Nelarius/imnodes/issues/59, https://github.com/Nelarius/imnodes/issues/58

We should only iterate over the nodes which have actually been submitted this frame. We already maintain the list of submitted node indices, so it could be used for this purpose as well.

Once this is done, this commit can be reverted: https://github.com/Nelarius/imnodes/commit/f1bda7257d3eb0bb1942e465c4174211ae577f29.

Secondary concerns

  1. ObjectPool::free_list is updated every frame. It should be enough to add the free slot once to the list and retain it.
  2. ObjectPool::in_use is not needed, if we can compare the submission indices of this frame and the previous frame.

Nelarius avatar Jan 27 '21 18:01 Nelarius