Lines Matching refs:memblock

17 	ASSERT_NE(memblock.memory.regions, NULL);  in memblock_initialization_check()
18 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_initialization_check()
19 ASSERT_EQ(memblock.memory.max, EXPECTED_MEMBLOCK_REGIONS); in memblock_initialization_check()
20 ASSERT_EQ(strcmp(memblock.memory.name, "memory"), 0); in memblock_initialization_check()
22 ASSERT_NE(memblock.reserved.regions, NULL); in memblock_initialization_check()
23 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_initialization_check()
24 ASSERT_EQ(memblock.memory.max, EXPECTED_MEMBLOCK_REGIONS); in memblock_initialization_check()
25 ASSERT_EQ(strcmp(memblock.reserved.name, "reserved"), 0); in memblock_initialization_check()
27 ASSERT_EQ(memblock.bottom_up, false); in memblock_initialization_check()
28 ASSERT_EQ(memblock.current_limit, MEMBLOCK_ALLOC_ANYWHERE); in memblock_initialization_check()
45 rgn = &memblock.memory.regions[0]; in memblock_add_simple_check()
60 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_add_simple_check()
61 ASSERT_EQ(memblock.memory.total_size, r.size); in memblock_add_simple_check()
78 rgn = &memblock.memory.regions[0]; in memblock_add_node_simple_check()
97 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_add_node_simple_check()
98 ASSERT_EQ(memblock.memory.total_size, r.size); in memblock_add_node_simple_check()
121 rgn1 = &memblock.memory.regions[0]; in memblock_add_disjoint_check()
122 rgn2 = &memblock.memory.regions[1]; in memblock_add_disjoint_check()
145 ASSERT_EQ(memblock.memory.cnt, 2); in memblock_add_disjoint_check()
146 ASSERT_EQ(memblock.memory.total_size, r1.size + r2.size); in memblock_add_disjoint_check()
175 rgn = &memblock.memory.regions[0]; in memblock_add_overlap_top_check()
197 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_add_overlap_top_check()
198 ASSERT_EQ(memblock.memory.total_size, total_size); in memblock_add_overlap_top_check()
227 rgn = &memblock.memory.regions[0]; in memblock_add_overlap_bottom_check()
249 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_add_overlap_bottom_check()
250 ASSERT_EQ(memblock.memory.total_size, total_size); in memblock_add_overlap_bottom_check()
276 rgn = &memblock.memory.regions[0]; in memblock_add_within_check()
296 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_add_within_check()
297 ASSERT_EQ(memblock.memory.total_size, r1.size); in memblock_add_within_check()
322 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_add_twice_check()
323 ASSERT_EQ(memblock.memory.total_size, r.size); in memblock_add_twice_check()
347 rgn = &memblock.memory.regions[0]; in memblock_add_between_check()
374 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_add_between_check()
375 ASSERT_EQ(memblock.memory.total_size, total_size); in memblock_add_between_check()
401 rgn = &memblock.memory.regions[0]; in memblock_add_near_max_check()
418 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_add_near_max_check()
419 ASSERT_EQ(memblock.memory.total_size, total_size); in memblock_add_near_max_check()
463 orig_region = memblock.memory.regions; in memblock_add_many_check()
473 ASSERT_EQ(memblock.memory.cnt, i + 2); in memblock_add_many_check()
474 ASSERT_EQ(memblock.memory.total_size, new_memory_regions_size + in memblock_add_many_check()
482 ASSERT_EQ(memblock.memory.max, INIT_MEMBLOCK_REGIONS * 2); in memblock_add_many_check()
485 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_add_many_check()
486 ASSERT_EQ(memblock.reserved.total_size, new_memory_regions_size); in memblock_add_many_check()
493 ASSERT_EQ(memblock.memory.regions[0].base, r.base); in memblock_add_many_check()
494 ASSERT_EQ(memblock.memory.regions[0].size, r.size); in memblock_add_many_check()
496 ASSERT_EQ(memblock.memory.cnt, INIT_MEMBLOCK_REGIONS + 2); in memblock_add_many_check()
497 ASSERT_EQ(memblock.memory.total_size, INIT_MEMBLOCK_REGIONS * size + in memblock_add_many_check()
500 ASSERT_EQ(memblock.memory.max, INIT_MEMBLOCK_REGIONS * 2); in memblock_add_many_check()
510 memblock.memory.regions = orig_region; in memblock_add_many_check()
511 memblock.memory.cnt = INIT_MEMBLOCK_REGIONS; in memblock_add_many_check()
550 rgn = &memblock.reserved.regions[0]; in memblock_reserve_simple_check()
585 rgn1 = &memblock.reserved.regions[0]; in memblock_reserve_disjoint_check()
586 rgn2 = &memblock.reserved.regions[1]; in memblock_reserve_disjoint_check()
609 ASSERT_EQ(memblock.reserved.cnt, 2); in memblock_reserve_disjoint_check()
610 ASSERT_EQ(memblock.reserved.total_size, r1.size + r2.size); in memblock_reserve_disjoint_check()
640 rgn = &memblock.reserved.regions[0]; in memblock_reserve_overlap_top_check()
662 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_reserve_overlap_top_check()
663 ASSERT_EQ(memblock.reserved.total_size, total_size); in memblock_reserve_overlap_top_check()
693 rgn = &memblock.reserved.regions[0]; in memblock_reserve_overlap_bottom_check()
715 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_reserve_overlap_bottom_check()
716 ASSERT_EQ(memblock.reserved.total_size, total_size); in memblock_reserve_overlap_bottom_check()
744 rgn = &memblock.reserved.regions[0]; in memblock_reserve_within_check()
764 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_reserve_within_check()
765 ASSERT_EQ(memblock.reserved.total_size, r1.size); in memblock_reserve_within_check()
791 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_reserve_twice_check()
792 ASSERT_EQ(memblock.reserved.total_size, r.size); in memblock_reserve_twice_check()
816 rgn = &memblock.reserved.regions[0]; in memblock_reserve_between_check()
843 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_reserve_between_check()
844 ASSERT_EQ(memblock.reserved.total_size, total_size); in memblock_reserve_between_check()
870 rgn = &memblock.reserved.regions[0]; in memblock_reserve_near_max_check()
887 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_reserve_near_max_check()
888 ASSERT_EQ(memblock.reserved.total_size, total_size); in memblock_reserve_near_max_check()
925 ASSERT_EQ(memblock.reserved.cnt, i + 1); in memblock_reserve_many_check()
926 ASSERT_EQ(memblock.reserved.total_size, (i + 1) * MEM_SIZE); in memblock_reserve_many_check()
932 orig_region = memblock.reserved.regions; in memblock_reserve_many_check()
950 ASSERT_EQ(memblock.reserved.cnt, INIT_MEMBLOCK_REGIONS + 2); in memblock_reserve_many_check()
951 ASSERT_EQ(memblock.reserved.total_size, (INIT_MEMBLOCK_REGIONS + 1) * MEM_SIZE + in memblock_reserve_many_check()
953 ASSERT_EQ(memblock.reserved.max, INIT_MEMBLOCK_REGIONS * 2); in memblock_reserve_many_check()
960 ASSERT_EQ(memblock.reserved.regions[0].base, r.base); in memblock_reserve_many_check()
961 ASSERT_EQ(memblock.reserved.regions[0].size, r.size); in memblock_reserve_many_check()
963 ASSERT_EQ(memblock.reserved.cnt, INIT_MEMBLOCK_REGIONS + 3); in memblock_reserve_many_check()
964 ASSERT_EQ(memblock.reserved.total_size, (INIT_MEMBLOCK_REGIONS + 1) * MEM_SIZE + in memblock_reserve_many_check()
967 ASSERT_EQ(memblock.reserved.max, INIT_MEMBLOCK_REGIONS * 2); in memblock_reserve_many_check()
977 memblock.reserved.regions = orig_region; in memblock_reserve_many_check()
978 memblock.reserved.cnt = INIT_MEMBLOCK_RESERVED_REGIONS; in memblock_reserve_many_check()
1026 rgn = &memblock.memory.regions[0]; in memblock_remove_simple_check()
1047 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_remove_simple_check()
1048 ASSERT_EQ(memblock.memory.total_size, r2.size); in memblock_remove_simple_check()
1075 rgn = &memblock.memory.regions[0]; in memblock_remove_absent_check()
1095 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_remove_absent_check()
1096 ASSERT_EQ(memblock.memory.total_size, r1.size); in memblock_remove_absent_check()
1127 rgn = &memblock.memory.regions[0]; in memblock_remove_overlap_top_check()
1151 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_remove_overlap_top_check()
1152 ASSERT_EQ(memblock.memory.total_size, total_size); in memblock_remove_overlap_top_check()
1181 rgn = &memblock.memory.regions[0]; in memblock_remove_overlap_bottom_check()
1203 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_remove_overlap_bottom_check()
1204 ASSERT_EQ(memblock.memory.total_size, total_size); in memblock_remove_overlap_bottom_check()
1235 rgn1 = &memblock.memory.regions[0]; in memblock_remove_within_check()
1236 rgn2 = &memblock.memory.regions[1]; in memblock_remove_within_check()
1263 ASSERT_EQ(memblock.memory.cnt, 2); in memblock_remove_within_check()
1264 ASSERT_EQ(memblock.memory.total_size, total_size); in memblock_remove_within_check()
1282 rgn = &memblock.memory.regions[0]; in memblock_remove_only_region_check()
1298 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_remove_only_region_check()
1299 ASSERT_EQ(memblock.memory.total_size, 0); in memblock_remove_only_region_check()
1326 rgn = &memblock.memory.regions[0]; in memblock_remove_near_max_check()
1349 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_remove_near_max_check()
1350 ASSERT_EQ(memblock.memory.total_size, total_size); in memblock_remove_near_max_check()
1377 rgn1 = &memblock.memory.regions[0]; in memblock_remove_overlap_two_check()
1378 rgn2 = &memblock.memory.regions[1]; in memblock_remove_overlap_two_check()
1412 ASSERT_EQ(memblock.memory.cnt, 2); in memblock_remove_overlap_two_check()
1413 ASSERT_EQ(memblock.memory.total_size, total_size); in memblock_remove_overlap_two_check()
1459 rgn = &memblock.reserved.regions[0]; in memblock_free_simple_check()
1480 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_free_simple_check()
1481 ASSERT_EQ(memblock.reserved.total_size, r2.size); in memblock_free_simple_check()
1508 rgn = &memblock.reserved.regions[0]; in memblock_free_absent_check()
1528 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_free_absent_check()
1529 ASSERT_EQ(memblock.reserved.total_size, r1.size); in memblock_free_absent_check()
1560 rgn = &memblock.reserved.regions[0]; in memblock_free_overlap_top_check()
1582 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_free_overlap_top_check()
1583 ASSERT_EQ(memblock.reserved.total_size, total_size); in memblock_free_overlap_top_check()
1609 rgn = &memblock.reserved.regions[0]; in memblock_free_overlap_bottom_check()
1631 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_free_overlap_bottom_check()
1632 ASSERT_EQ(memblock.reserved.total_size, total_size); in memblock_free_overlap_bottom_check()
1663 rgn1 = &memblock.reserved.regions[0]; in memblock_free_within_check()
1664 rgn2 = &memblock.reserved.regions[1]; in memblock_free_within_check()
1691 ASSERT_EQ(memblock.reserved.cnt, 2); in memblock_free_within_check()
1692 ASSERT_EQ(memblock.reserved.total_size, total_size); in memblock_free_within_check()
1710 rgn = &memblock.reserved.regions[0]; in memblock_free_only_region_check()
1726 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_free_only_region_check()
1727 ASSERT_EQ(memblock.reserved.total_size, 0); in memblock_free_only_region_check()
1753 rgn = &memblock.reserved.regions[0]; in memblock_free_near_max_check()
1776 ASSERT_EQ(memblock.reserved.cnt, 1); in memblock_free_near_max_check()
1777 ASSERT_EQ(memblock.reserved.total_size, total_size); in memblock_free_near_max_check()
1804 rgn1 = &memblock.reserved.regions[0]; in memblock_free_overlap_two_check()
1805 rgn2 = &memblock.reserved.regions[1]; in memblock_free_overlap_two_check()
1839 ASSERT_EQ(memblock.reserved.cnt, 2); in memblock_free_overlap_two_check()
1840 ASSERT_EQ(memblock.reserved.total_size, total_size); in memblock_free_overlap_two_check()
1872 ASSERT_EQ(memblock.bottom_up, false); in memblock_set_bottom_up_check()
1874 ASSERT_EQ(memblock.bottom_up, true); in memblock_set_bottom_up_check()
1887 ASSERT_EQ(memblock_bottom_up(), memblock.bottom_up); in memblock_bottom_up_check()
1890 ASSERT_EQ(memblock_bottom_up(), memblock.bottom_up); in memblock_bottom_up_check()
1921 rgn = &memblock.memory.regions[0]; in memblock_trim_memory_aligned_check()
1937 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_trim_memory_aligned_check()
1967 rgn = &memblock.memory.regions[0]; in memblock_trim_memory_too_small_check()
1988 ASSERT_EQ(memblock.memory.cnt, 1); in memblock_trim_memory_too_small_check()
2021 rgn1 = &memblock.memory.regions[0]; in memblock_trim_memory_unaligned_base_check()
2022 rgn2 = &memblock.memory.regions[1]; in memblock_trim_memory_unaligned_base_check()
2049 ASSERT_EQ(memblock.memory.cnt, 2); in memblock_trim_memory_unaligned_base_check()
2082 rgn1 = &memblock.memory.regions[0]; in memblock_trim_memory_unaligned_end_check()
2083 rgn2 = &memblock.memory.regions[1]; in memblock_trim_memory_unaligned_end_check()
2109 ASSERT_EQ(memblock.memory.cnt, 2); in memblock_trim_memory_unaligned_end_check()