Introduce CSSLayoutSetMemoryFuncs
Summary: - Add CSSLayoutSetMemoryFuncs function which allows application to replace malloc, calloc, realloc and free with application's functions, like zalloc and zfree of zlib. - Fixed memory leaks in tests. - Close #247 For example, to use dlmalloc with USE_DL_PREFIX CSSLayoutSetMemoryFuncs(&dlmalloc, &dlcalloc, &dlrealloc, &dlfree); Reviewed By: emilsjolander Differential Revision: D4178386 fbshipit-source-id: a79dbdaf82a512f42cc43f99dbc49faba296903b
This commit is contained in:
committed by
Facebook Github Bot
parent
667858990c
commit
ef81d4b0c7
@@ -83,11 +83,14 @@ TEST(CSSLayoutTest, dirty_node_only_if_children_are_actually_removed) {
|
||||
|
||||
CSSNodeCalculateLayout(root, CSSUndefined, CSSUndefined, CSSDirectionLTR);
|
||||
|
||||
CSSNodeRemoveChild(root, CSSNodeNew());
|
||||
const CSSNodeRef child1 = CSSNodeNew();
|
||||
CSSNodeRemoveChild(root, child1);
|
||||
EXPECT_FALSE(CSSNodeIsDirty(root));
|
||||
CSSNodeFree(child1);
|
||||
|
||||
CSSNodeRemoveChild(root, child0);
|
||||
EXPECT_TRUE(CSSNodeIsDirty(root));
|
||||
CSSNodeFree(child0);
|
||||
|
||||
CSSNodeFreeRecursive(root);
|
||||
}
|
||||
|
Reference in New Issue
Block a user