Commit 2e4edc2
Clean up YogaLayoutableShadowNode (re-enable assert, name sentinel, document ABA) (#57064)
Summary:
Pull Request resolved: #57064
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 9d910a5 commit 2e4edc2
2 files changed
Lines changed: 26 additions & 22 deletions
File tree
- packages/react-native/ReactCommon/react/renderer/components/view
Lines changed: 26 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
114 | 110 | | |
115 | | - | |
116 | 111 | | |
117 | 112 | | |
118 | 113 | | |
| |||
326 | 321 | | |
327 | 322 | | |
328 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
329 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
330 | 343 | | |
331 | 344 | | |
332 | | - | |
333 | | - | |
| 345 | + | |
334 | 346 | | |
335 | 347 | | |
336 | 348 | | |
| |||
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