react-native/ReactCommon/fabric
Valentin Shergin 938e1d51c4 Fabric: ShadowNode::children_ is now managed in copy-on-write manner
Summary:
@public
ShadowNode class is designed to share `props` and `children` objects between instances. Given that all *Props classes are immutable, it's very easy to share them and we do this from the day one. The `children_` collection is more tricky though because ShadowNode class has a couple of mutation methods. Previously, we dealt with it very simply by copying the whole vector in constructors, and that was far from optimal. Now we store a special flag that indicates that the children list is shared among nodes, and we clone this before the first mutation.
Sharing a `shared_ptr` should be much more efficient (cost of atomic refcount increment) than instantiating whole new collection (an allocation).

Reviewed By: mdvacca

Differential Revision: D8988386

fbshipit-source-id: cb2f6b2fccac70a35e070a1aa108d135f77cd041
2018-08-04 09:47:30 -07:00
..
attributedstring Fabric: `SharedColor` for Android 2018-07-17 18:17:27 -07:00
components Fabric: `ShadowNode::getChildren()` now returns `vector`, not `shared_ptr` 2018-08-04 09:47:30 -07:00
core Fabric: ShadowNode::children_ is now managed in copy-on-write manner 2018-08-04 09:47:30 -07:00
debug Fix conditional load usage. 2018-07-14 18:32:20 -07:00
events Fabric: Events related classes were moved to separate buck target 2018-07-17 22:53:57 -07:00
graphics Fabric: `SharedColor` for Android 2018-07-17 18:17:27 -07:00
imagemanager Fabric: Fixed image URLs parsing 2018-08-03 08:32:56 -07:00
sample Fabric: Introducing `ContextContainer` 2018-06-22 07:32:49 -07:00
textlayoutmanager Simplifying child nodes management in YogaLayoutableShadowNode 2018-07-17 22:53:56 -07:00
uimanager Fabric: `ShadowNode::getChildren()` now returns `vector`, not `shared_ptr` 2018-08-04 09:47:30 -07:00