From 7afddfd204d72580fed430161000108163280f5c Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 21 Apr 2023 13:54:50 -0700 Subject: [PATCH] Remove YGNode "reserved_" field (#36991) Summary: X-link: https://github.com/facebook/react-native/pull/36991 D15296732 added a byte to each YGNode exposed via private API, to stash random junk in. At the time, not adding to node size because of how fields ended up aligning. I'm not sure if this is still the case, but this is subject to change (e.g. adding a single extra flag). There is a per-node "context" already that can store arbitrary data, and this reserved space isn't public, so this API is already a bit suspect. The only place it is used is in instrumentation in fbandroid, enabled only in benchmarks, to store an enum to forward to QPL for what framework it thinks created the Yoga Node. This is already broken for React Native (worked for Paper only), and afaict isn't used anywhere. But it also has little reason to be caching more information on the node (beyond maybe saving a couple memory accesses) since it derives this information from the node config already. This removes the field. Changelog: [Internal] Reviewed By: rshest Differential Revision: D45137133 fbshipit-source-id: 75755b21102f7928b3ad947051c35b1a6566ef40 --- yoga/YGNode.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/yoga/YGNode.h b/yoga/YGNode.h index f759a877..098c1b5e 100644 --- a/yoga/YGNode.h +++ b/yoga/YGNode.h @@ -42,7 +42,6 @@ struct YOGA_EXPORT YGNode { private: void* context_ = nullptr; YGNodeFlags flags_ = {}; - uint8_t reserved_ = 0; union { YGMeasureFunc noContext; MeasureWithContextFn withContext; @@ -114,9 +113,6 @@ public: // Getters void* getContext() const { return context_; } - uint8_t& reserved() { return reserved_; } - uint8_t reserved() const { return reserved_; } - void print(void*); bool getHasNewLayout() const { return flags_.hasNewLayout; }