|
7 | 7 |
|
8 | 8 | #include <cstring> |
9 | 9 | #include <iostream> |
10 | | -#include <vector> |
11 | | - |
12 | 10 | #include <snmalloc/snmalloc_core.h> |
13 | 11 | #include <test/setup.h> |
| 12 | +#include <vector> |
14 | 13 |
|
15 | 14 | using namespace snmalloc; |
16 | 15 |
|
@@ -296,7 +295,7 @@ void test_remove_from_bin() |
296 | 295 | // chunk 4 (addr = 4*MCS), alpha = 4 |
297 | 296 | // chunk 12 (addr = 12*MCS), alpha = 4 (12 = 4*3, natural_alignment = 4) |
298 | 297 | // chunk 20 (addr = 20*MCS), alpha = 4 (20 = 4*5, natural_alignment = 4) |
299 | | - address_t a1 = chunk_addr(3); // 4*MCS |
| 298 | + address_t a1 = chunk_addr(3); // 4*MCS |
300 | 299 | address_t a2 = chunk_addr(11); // 12*MCS |
301 | 300 | address_t a3 = chunk_addr(19); // 20*MCS |
302 | 301 |
|
@@ -475,7 +474,7 @@ void test_coalesce_both() |
475 | 474 | BCCore bc{}; |
476 | 475 |
|
477 | 476 | // Insert blocks A and C with a gap between. |
478 | | - address_t a_addr = chunk_addr(3); // 4*MCS, 4 chunks |
| 477 | + address_t a_addr = chunk_addr(3); // 4*MCS, 4 chunks |
479 | 478 | address_t c_addr = chunk_addr(11); // 12*MCS, 4 chunks |
480 | 479 |
|
481 | 480 | bc.add_fresh_range(a_addr, chunk_size(4)); |
@@ -572,8 +571,8 @@ void test_stale_tag_after_absorption() |
572 | 571 | BCCore bc{}; |
573 | 572 |
|
574 | 573 | // Insert A, B, C adjacent: chunks 4-7, 8-11, 12-15. |
575 | | - address_t a_addr = chunk_addr(3); // 4*MCS |
576 | | - address_t b_addr = chunk_addr(7); // 8*MCS |
| 574 | + address_t a_addr = chunk_addr(3); // 4*MCS |
| 575 | + address_t b_addr = chunk_addr(7); // 8*MCS |
577 | 576 | address_t c_addr = chunk_addr(11); // 12*MCS |
578 | 577 | bc.add_fresh_range(a_addr, chunk_size(4)); |
579 | 578 | bc.add_fresh_range(b_addr, chunk_size(4)); |
@@ -656,6 +655,7 @@ void test_stress() |
656 | 655 | address_t addr; |
657 | 656 | size_t size; |
658 | 657 | }; |
| 658 | + |
659 | 659 | std::vector<Alloc> live; |
660 | 660 |
|
661 | 661 | // Insert some initial blocks. |
@@ -726,7 +726,8 @@ void test_carving_exact_fit() |
726 | 726 | CHECK(result.addr == addr); |
727 | 727 | CHECK(result.size == chunk_size(4)); |
728 | 728 |
|
729 | | - // Carving: aligned_addr = align_up(addr, 4*MCS) = addr since addr is 4-aligned. |
| 729 | + // Carving: aligned_addr = align_up(addr, 4*MCS) = addr since addr is |
| 730 | + // 4-aligned. |
730 | 731 | address_t aligned = bits::align_up(result.addr, chunk_size(4)); |
731 | 732 | CHECK(aligned == addr); |
732 | 733 | // No prefix, no suffix. |
@@ -757,8 +758,8 @@ void test_carving_with_prefix() |
757 | 758 | size_t suffix = result.size - prefix - chunk_size(4); |
758 | 759 |
|
759 | 760 | CHECK(aligned == chunk_addr(3)); // 4*MCS |
760 | | - CHECK(prefix == chunk_size(3)); // 3 chunks of prefix |
761 | | - CHECK(suffix == chunk_size(1)); // 1 chunk of suffix |
| 761 | + CHECK(prefix == chunk_size(3)); // 3 chunks of prefix |
| 762 | + CHECK(suffix == chunk_size(1)); // 1 chunk of suffix |
762 | 763 |
|
763 | 764 | // Return remainders to the pool. |
764 | 765 | if (prefix > 0) |
|
0 commit comments