summaryrefslogtreecommitdiff
path: root/ufdt_node_pool.c
AgeCommit message (Collapse)Author
2017-06-15Fix memory leak problem in ufdt_node_pool_destructSzuWei Lin
ufdt_node_pool could delay memory block freeing to enhance performance. The left memory blocks should be freed in ufdt_node_pool_destruct(). The patch fix the problem that a wrong code block to free left memory blocks. Bug: 62474732 Test: tests/run_stress_tests.sh with unmark VALGRIND in apply_overlay.sh Change-Id: I5fd2f51a342501ad5bc27b26d343893a822db6b5
2017-06-15Add stress test case and some debug symbolsSzuWei Lin
- A test case run_stress_tests.sh with a larger DTO test case - A flag to test with enabling valgrind - A flag to dump dtb when testing - A flag to disable memory pool machanism Bug: 62474732 Test: tests/run_stress_tests.sh with enabling flags Change-Id: Ibe4c3d1098bc732d21218e1bdc01eed49cf9e440
2017-04-25libufdt: reduce the number of malloc/free callingSzuWei Lin
The performance of some bootloader malloc/free implementation isn't optimized, but libufdt calls huge number of malloc/free to build a real tree data structure. The patch adds an ufdt_node_pool to reduce the number of malloc/free. ufdt_node_pool asks a larger memory block in each time, and distributes the memory into several ufdt_node (ufdt_node_fdt_prop or ufdt_node_fdt_node). libufdt doesn't need to call malloc() to allocate memory until out of larger memory block. The setting of this patch is 1024 nodes in each memory block, so it can reduce ~1023/1024 malloc/free calling times after the patch is applied. Bug: 32969430 Test: ./tests/run_tests.sh Test: ./tests/run_performance_test.sh Change-Id: Id95e74da1235b9e2fc306500686515ee6b93017d