Blender Git Commit Log

Git Commits -> Revision a31609a

Revision a31609a by Lukas Toenne (object_nodes, strand_nodes)
January 18, 2016, 12:05 (GMT)
Two-level use-count system for bvm pointer variables.

The rationale for this change is that copying variables on the bvm stack
will become necessary for compound variables (structs). In order to
efficiently keep pointers on the stack without making deep copies every
time such a variable is copied, the pointer must be a kind of shared_ptr
concept. In addition to this the stack variable itself must also be counted,
so that we have a way of detecting when it "goes out of scope", i.e. all
nodes using it have finished.

The node_counted_ptr is not a full C++ shared_ptr, because the user counting
is handled explicitly by the compiled bvm instructions. Using a std::shared_ptr
would be difficult due to the mixed levels of evaluation (compile-time constants,
storing shared_ptr on the opaque stack), and because of difficult interfacing
with C code (returning persistent plain pointers).

Commit Details:

Full Hash: a31609a6becade0c726f1d3113c66985c994c87e
Parent Commit: 0549e0e
Lines Changed: +149, -56

4 Modified Paths:

/source/blender/blenvm/bvm/bvm_eval.cc (+2, -1) (Diff)
/source/blender/blenvm/compile/bvm_nodegraph.cc (+5, -5) (Diff)
/source/blender/blenvm/intern/bvm_api.cc (+5, -5) (Diff)
/source/blender/blenvm/util/bvm_util_data_ptr.h (+137, -45) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021