Remove Yoga-internal.h (#1452)
Summary: X-link: https://github.com/facebook/react-native/pull/41346 Pull Request resolved: https://github.com/facebook/yoga/pull/1452 This removes the last remnant from `Yoga-interna.h`, `YGNodeDellocate()`. The API is renamed to `YGNodeFinalize` to give it the explicit purpose of freeing the node from a garbage collector, and made public with that documented contract. With that, every top-level header is now a public API, and Yoga's JNI bindings do not need to rely on private headers anymore. Changelog: [Internal] Reviewed By: joevilches Differential Revision: D51014340 fbshipit-source-id: 553f04b62c78b76f9102cd6197146650955aeec5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9eb8a62739
commit
12a8d16b62
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
#include <yoga/Yoga.h>
|
||||
|
||||
YG_EXTERN_C_BEGIN
|
||||
|
||||
// Deallocates a Yoga Node. Unlike YGNodeFree, does not remove the node from
|
||||
// its parent or children.
|
||||
YG_EXPORT void YGNodeDeallocate(YGNodeRef node);
|
||||
|
||||
YG_EXTERN_C_END
|
@@ -5,7 +5,6 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <yoga/Yoga-internal.h>
|
||||
#include <yoga/Yoga.h>
|
||||
|
||||
#include <yoga/algorithm/Cache.h>
|
||||
@@ -136,10 +135,12 @@ void YGNodeFree(const YGNodeRef nodeRef) {
|
||||
}
|
||||
|
||||
node->clearChildren();
|
||||
YGNodeDeallocate(node);
|
||||
|
||||
Event::publish<Event::NodeDeallocation>(node, {YGNodeGetConfig(node)});
|
||||
delete resolveRef(node);
|
||||
}
|
||||
|
||||
void YGNodeDeallocate(const YGNodeRef node) {
|
||||
void YGNodeFinalize(const YGNodeRef node) {
|
||||
Event::publish<Event::NodeDeallocation>(node, {YGNodeGetConfig(node)});
|
||||
delete resolveRef(node);
|
||||
}
|
||||
|
@@ -59,6 +59,12 @@ YG_EXPORT void YGNodeFreeRecursiveWithCleanupFunc(
|
||||
YGNodeRef node,
|
||||
YGNodeCleanupFunc cleanup);
|
||||
YG_EXPORT void YGNodeFreeRecursive(YGNodeRef node);
|
||||
|
||||
// Frees the Yoga node without disconnecting it from its owner or children.
|
||||
// Allows garbage collecting Yoga nodes in parallel when the entire tree is
|
||||
// unrechable.
|
||||
YG_EXPORT void YGNodeFinalize(YGNodeRef node);
|
||||
|
||||
YG_EXPORT void YGNodeReset(YGNodeRef node);
|
||||
|
||||
YG_EXPORT void YGNodeInsertChild(YGNodeRef node, YGNodeRef child, size_t index);
|
||||
|
Reference in New Issue
Block a user