Skip to content

Commit 4be848a

Browse files
committed
refactor: use 8 byte alignment
1 parent 7cba5e9 commit 4be848a

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ void YogaLayoutableShadowNode::updateYogaChildrenOwnersIfNeeded() {
338338
// initialised function-local static.
339339
// NOLINTBEGIN(cppcoreguidelines-pro-type-reinterpret-cast)
340340
static auto* const kDetachedYogaNodeOwnerSentinel =
341-
reinterpret_cast<yoga::Node*>(0xBADC0FFEE0DDF00DULL);
341+
reinterpret_cast<yoga::Node*>(0xBADC0FFEE0DDF000ULL);
342342
// NOLINTEND(cppcoreguidelines-pro-type-reinterpret-cast)
343343
for (auto& childYogaNode : yogaNode_.getChildren()) {
344344
if (YGNodeGetOwner(childYogaNode) == &yogaNode_) {

packages/react-native/ReactCommon/yoga/yoga/YGNode.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,17 +279,11 @@ size_t YGNodeGetChildCount(const YGNodeConstRef node) {
279279
}
280280

281281
YGNodeRef YGNodeGetOwner(const YGNodeRef node) {
282-
// The owner is returned verbatim as an opaque handle. It may hold a
283-
// non-dereferenceable sentinel value, so it must not undergo a
284-
// derived-to-base conversion that asserts pointer alignment/validity.
285-
return reinterpret_cast<YGNodeRef>(resolveRef(node)->getOwner());
282+
return resolveRef(node)->getOwner();
286283
}
287284

288285
YGNodeRef YGNodeGetParent(const YGNodeRef node) {
289-
// The owner is returned verbatim as an opaque handle. It may hold a
290-
// non-dereferenceable sentinel value, so it must not undergo a
291-
// derived-to-base conversion that asserts pointer alignment/validity.
292-
return reinterpret_cast<YGNodeRef>(resolveRef(node)->getOwner());
286+
return resolveRef(node)->getOwner();
293287
}
294288

295289
void YGNodeSetConfig(YGNodeRef node, YGConfigRef config) {

0 commit comments

Comments
 (0)