Blender Git Loki
Git Commits -> Revision a31609a
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