From d0aeabb8f0b3509212ff22a894962eaa4c34fba2 Mon Sep 17 00:00:00 2001 From: Lukas Woehrl Date: Thu, 5 Jan 2017 06:09:22 -0800 Subject: [PATCH] Optimized memory alignment Summary: It's not much, but still 4 bytes saved here by moving the ```bool```s together. (on compilers where ```bool``` is a single byte) Closes https://github.com/facebook/yoga/pull/319 Reviewed By: gkassabli, passy Differential Revision: D4383686 Pulled By: emilsjolander fbshipit-source-id: 9a48eccbb69382850c016aa6ee730526704a15f2 --- yoga/Yoga.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/yoga/Yoga.c b/yoga/Yoga.c index d4285444..df176de0 100644 --- a/yoga/Yoga.c +++ b/yoga/Yoga.c @@ -94,16 +94,18 @@ typedef struct YGNode { YGStyle style; YGLayout layout; uint32_t lineIndex; - bool hasNewLayout; + YGNodeRef parent; YGNodeListRef children; - bool isDirty; struct YGNode *nextChild; YGMeasureFunc measure; YGPrintFunc print; void *context; + + bool isDirty; + bool hasNewLayout; } YGNode; #define YG_UNDEFINED_VALUES \