Skip to content

Clean up YogaLayoutableShadowNode (re-enable assert, name sentinel, document ABA) (#57064)#57064

Closed
javache wants to merge 1 commit into
facebook:mainfrom
javache:export-D107079944
Closed

Clean up YogaLayoutableShadowNode (re-enable assert, name sentinel, document ABA) (#57064)#57064
javache wants to merge 1 commit into
facebook:mainfrom
javache:export-D107079944

Conversation

@javache
Copy link
Copy Markdown
Member

@javache javache commented Jun 3, 2026

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: D107079944

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 3, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Jun 3, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jun 3, 2026

@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D107079944.

@meta-codesync meta-codesync Bot changed the title Clean up YogaLayoutableShadowNode (re-enable assert, name sentinel, document ABA) Clean up YogaLayoutableShadowNode (re-enable assert, name sentinel, document ABA) (#57064) Jun 3, 2026
javache added a commit to javache/react-native that referenced this pull request Jun 3, 2026
…ocument ABA) (facebook#57064)

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: D107079944
@javache javache force-pushed the export-D107079944 branch from 7a5bae6 to 872e741 Compare June 3, 2026 20:25
…ocument ABA) (facebook#57064)

Summary:
Pull Request resolved: facebook#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: D107079944
@javache javache force-pushed the export-D107079944 branch from 872e741 to 2e4edc2 Compare June 3, 2026 20:28
@meta-codesync meta-codesync Bot closed this in 3fd8e9b Jun 4, 2026
@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @javache in 3fd8e9b

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Jun 4, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jun 4, 2026

This pull request has been merged in 3fd8e9b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants