From fde4db9383beb6187d87cf6eaf14f3a59187b303 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 26 Apr 2017 11:49:26 -0700 Subject: [PATCH] Add YGConfigCopy Summary: Closes https://github.com/facebook/yoga/pull/525 Differential Revision: D4953723 Pulled By: emilsjolander fbshipit-source-id: 1c54f40dfae5054822a440edf9d0aafb22a465d9 --- yoga/Yoga.c | 4 ++++ yoga/Yoga.h | 1 + 2 files changed, 5 insertions(+) diff --git a/yoga/Yoga.c b/yoga/Yoga.c index b90fb49f..fb21966c 100644 --- a/yoga/Yoga.c +++ b/yoga/Yoga.c @@ -391,6 +391,10 @@ void YGConfigFree(const YGConfigRef config) { gConfigInstanceCount--; } +void YGConfigCopy(const YGConfigRef dest, const YGConfigRef src) { + memcpy(dest, src, sizeof(YGConfig)); +} + static void YGNodeMarkDirtyInternal(const YGNodeRef node) { if (!node->isDirty) { node->isDirty = true; diff --git a/yoga/Yoga.h b/yoga/Yoga.h index 86b63ded..4a6de72b 100644 --- a/yoga/Yoga.h +++ b/yoga/Yoga.h @@ -228,6 +228,7 @@ WIN_EXPORT void YGConfigSetPointScaleFactor(const YGConfigRef config, const floa // YGConfig WIN_EXPORT YGConfigRef YGConfigNew(void); WIN_EXPORT void YGConfigFree(const YGConfigRef config); +WIN_EXPORT void YGConfigCopy(const YGConfigRef dest, const YGConfigRef src); WIN_EXPORT int32_t YGConfigGetInstanceCount(void); WIN_EXPORT void YGConfigSetExperimentalFeatureEnabled(const YGConfigRef config,