Commit 7a5bae6
Clean up YogaLayoutableShadowNode (re-enable assert, name sentinel, document ABA)
Summary:
Three small cleanups uncovered during review of the clone path:
- Re-enable the dirty-flag inheritance assert in the clone
constructor. It was disabled while the background executor was
potentially racing the JS thread; background executor is no
longer in use, so the assert is meaningful again.
- Lift the `0xBADC0FFEE0DDF00D` magic owner sentinel out into a
named `yoga::Node* const` (`reinterpret_cast` is not constexpr,
so it can't be `constexpr`). The bit pattern stays the same so
it remains recognisable in debuggers.
- Move the explanatory comment for `updateYogaChildrenOwnersIfNeeded`
next to its implementation and rewrite it to clearly describe the
ABA scenario it guards against (and the common no-op case).
Changelog:
[Internal]
Reviewed By: christophpurrer
Differential Revision: D1070799441 parent a0628b5 commit 7a5bae6
2 files changed
Lines changed: 29 additions & 22 deletions
File tree
- packages/react-native/ReactCommon/react/renderer/components/view
Lines changed: 29 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
67 | 77 | | |
68 | 78 | | |
69 | 79 | | |
| |||
100 | 110 | | |
101 | 111 | | |
102 | 112 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
114 | 120 | | |
115 | | - | |
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
| |||
326 | 331 | | |
327 | 332 | | |
328 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
329 | 345 | | |
330 | 346 | | |
331 | 347 | | |
332 | | - | |
333 | | - | |
| 348 | + | |
334 | 349 | | |
335 | 350 | | |
336 | 351 | | |
| |||
Lines changed: 0 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | 111 | | |
120 | 112 | | |
121 | 113 | | |
| |||
0 commit comments