Skip to content

Commit

Permalink
Deleted YGSetMemoryFucs as it is unused
Browse files Browse the repository at this point in the history
Reviewed By: emilsjolander

Differential Revision: D6374147

fbshipit-source-id: 8c896dce23571268a1a52df5cc72486af9d66df7
  • Loading branch information
priteshrnandgaonkar authored and facebook-github-bot committed Nov 21, 2017
1 parent 33cefc1 commit d950dc6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
20 changes: 0 additions & 20 deletions ReactCommon/yoga/yoga/Yoga.c
Original file line number Diff line number Diff line change
Expand Up @@ -3816,23 +3816,3 @@ void *YGConfigGetContext(const YGConfigRef config) {
void YGConfigSetNodeClonedFunc(const YGConfigRef config, const YGNodeClonedFunc callback) {
config->cloneNodeCallback = callback;
}

void YGSetMemoryFuncs(YGMalloc ygmalloc, YGCalloc yccalloc, YGRealloc ygrealloc, YGFree ygfree) {
YGAssert(gNodeInstanceCount == 0 && gConfigInstanceCount == 0,
"Cannot set memory functions: all node must be freed first");
YGAssert((ygmalloc == NULL && yccalloc == NULL && ygrealloc == NULL && ygfree == NULL) ||
(ygmalloc != NULL && yccalloc != NULL && ygrealloc != NULL && ygfree != NULL),
"Cannot set memory functions: functions must be all NULL or Non-NULL");

if (ygmalloc == NULL || yccalloc == NULL || ygrealloc == NULL || ygfree == NULL) {
gYGMalloc = &malloc;
gYGCalloc = &calloc;
gYGRealloc = &realloc;
gYGFree = &free;
} else {
gYGMalloc = ygmalloc;
gYGCalloc = yccalloc;
gYGRealloc = ygrealloc;
gYGFree = ygfree;
}
}
3 changes: 0 additions & 3 deletions ReactCommon/yoga/yoga/Yoga.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,4 @@ WIN_EXPORT YGConfigRef YGConfigGetDefault(void);
WIN_EXPORT void YGConfigSetContext(const YGConfigRef config, void *context);
WIN_EXPORT void *YGConfigGetContext(const YGConfigRef config);

WIN_EXPORT void
YGSetMemoryFuncs(YGMalloc ygmalloc, YGCalloc yccalloc, YGRealloc ygrealloc, YGFree ygfree);

YG_EXTERN_C_END

0 comments on commit d950dc6

Please sign in to comment.