YGNode
: one byte of private storage
Summary: Adds one byte of private storage to `YGNode`, intended to be used by Yoga itself. This is in previously unused alignment space, and won’t cause more memory to be allocated. Reviewed By: SidharthGuglani Differential Revision: D15296732 fbshipit-source-id: 3caf0a3cd506e4e324e51c31869c69be5781d476
This commit is contained in:
committed by
Facebook Github Bot
parent
1180afed9c
commit
8dc46c0a87
@@ -5,6 +5,7 @@
|
|||||||
* file in the root directory of this source tree.
|
* file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include <cstdint>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "CompactValue.h"
|
#include "CompactValue.h"
|
||||||
#include "YGConfig.h"
|
#include "YGConfig.h"
|
||||||
@@ -27,6 +28,7 @@ private:
|
|||||||
bool measureUsesContext_ : 1;
|
bool measureUsesContext_ : 1;
|
||||||
bool baselineUsesContext_ : 1;
|
bool baselineUsesContext_ : 1;
|
||||||
bool printUsesContext_ : 1;
|
bool printUsesContext_ : 1;
|
||||||
|
uint8_t reserved_ = 0;
|
||||||
union {
|
union {
|
||||||
YGMeasureFunc noContext;
|
YGMeasureFunc noContext;
|
||||||
MeasureWithContextFn withContext;
|
MeasureWithContextFn withContext;
|
||||||
@@ -91,6 +93,9 @@ public:
|
|||||||
// Getters
|
// Getters
|
||||||
void* getContext() const { return context_; }
|
void* getContext() const { return context_; }
|
||||||
|
|
||||||
|
uint8_t& reserved() { return reserved_; }
|
||||||
|
uint8_t reserved() const { return reserved_; }
|
||||||
|
|
||||||
void print(void*);
|
void print(void*);
|
||||||
|
|
||||||
bool getHasNewLayout() const { return hasNewLayout_; }
|
bool getHasNewLayout() const { return hasNewLayout_; }
|
||||||
|
Reference in New Issue
Block a user