ASSERT_EQ(capacity, al1.debug_get_free());
auto i1 = al1.allocate_l1_cont(0x1000, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i1.offset, 0);
- ASSERT_EQ(i1.length, 0x1000);
+ ASSERT_EQ(i1.offset, 0u);
+ ASSERT_EQ(i1.length, 0x1000u);
ASSERT_EQ(capacity - 0x1000, al1.debug_get_free());
auto i2 = al1.allocate_l1_cont(0x1000, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i2.offset, 0x1000);
- ASSERT_EQ(i2.length, 0x1000);
+ ASSERT_EQ(i2.offset, 0x1000u);
+ ASSERT_EQ(i2.length, 0x1000u);
al1.free_l1(i2);
al1.free_l1(i1);
i1 = al1.allocate_l1_cont(0x1000, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i1.offset, 0);
- ASSERT_EQ(i1.length, 0x1000);
+ ASSERT_EQ(i1.offset, 0u);
+ ASSERT_EQ(i1.length, 0x1000u);
i2 = al1.allocate_l1_cont(0x1000, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i2.offset, 0x1000);
- ASSERT_EQ(i2.length, 0x1000);
+ ASSERT_EQ(i2.offset, 0x1000u);
+ ASSERT_EQ(i2.length, 0x1000u);
al1.free_l1(i1);
al1.free_l1(i2);
i1 = al1.allocate_l1_cont(0x2000, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i1.offset, 0);
- ASSERT_EQ(i1.length, 0x2000);
+ ASSERT_EQ(i1.offset, 0u);
+ ASSERT_EQ(i1.length, 0x2000u);
i2 = al1.allocate_l1_cont(0x3000, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i2.offset, 0x2000);
- ASSERT_EQ(i2.length, 0x3000);
+ ASSERT_EQ(i2.offset, 0x2000u);
+ ASSERT_EQ(i2.length, 0x3000u);
al1.free_l1(i1);
al1.free_l1(i2);
i1 = al1.allocate_l1_cont(0x2000, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i1.offset, 0);
- ASSERT_EQ(i1.length, 0x2000);
+ ASSERT_EQ(i1.offset, 0u);
+ ASSERT_EQ(i1.length, 0x2000u);
i2 = al1.allocate_l1_cont(2 * 1024 * 1024, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i2.offset, 2 * 1024 * 1024);
- ASSERT_EQ(i2.length, 2 * 1024 * 1024);
+ ASSERT_EQ(i2.offset, 2u * 1024u * 1024u);
+ ASSERT_EQ(i2.length, 2u * 1024u * 1024u);
al1.free_l1(i1);
i1 = al1.allocate_l1_cont(1024 * 1024, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i1.offset, 0);
- ASSERT_EQ(i1.length, 1024 * 1024);
+ ASSERT_EQ(i1.offset, 0u);
+ ASSERT_EQ(i1.length, 1024u * 1024u);
auto i3 = al1.allocate_l1_cont(1024 * 1024 + 0x1000, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i3.offset, 2 * 2 * 1024 * 1024);
- ASSERT_EQ(i3.length, 1024 * 1024 + 0x1000);
+ ASSERT_EQ(i3.offset, 2u * 2u * 1024u * 1024u);
+ ASSERT_EQ(i3.length, 1024u * 1024u + 0x1000u);
// here we have the following layout:
// Alloc: 0~1M, 2M~2M, 4M~1M+4K
al1.free_l1(i4);
i4 = al1.allocate_l1_cont(1024 * 1024 - 0x1000, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i4.offset, 5 * 1024 * 1024 + 0x1000);
- ASSERT_EQ(i4.length, 1024 * 1024 - 0x1000);
+ ASSERT_EQ(i4.offset, 5u * 1024u * 1024u + 0x1000u);
+ ASSERT_EQ(i4.length, 1024u * 1024u - 0x1000u);
al1.free_l1(i4);
i4 = al1.allocate_l1_cont(1024 * 1024 + 0x1000, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i4.offset, 6 * 1024 * 1024);
+ ASSERT_EQ(i4.offset, 6u * 1024u * 1024u);
//ASSERT_EQ(i4.offset, 5 * 1024 * 1024 + 0x1000);
- ASSERT_EQ(i4.length, 1024 * 1024 + 0x1000);
+ ASSERT_EQ(i4.length, 1024u * 1024u + 0x1000u);
al1.free_l1(i1);
al1.free_l1(i2);
al1.free_l1(i4);
i1 = al1.allocate_l1_cont(1024 * 1024, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i1.offset, 0);
- ASSERT_EQ(i1.length, 1024 * 1024);
+ ASSERT_EQ(i1.offset, 0u);
+ ASSERT_EQ(i1.length, 1024u * 1024u);
i2 = al1.allocate_l1_cont(1024 * 1024, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i2.offset, 1 * 1024 * 1024);
- ASSERT_EQ(i2.length, 1024 * 1024 );
+ ASSERT_EQ(i2.offset, 1u * 1024u * 1024u);
+ ASSERT_EQ(i2.length, 1024u * 1024u);
i3 = al1.allocate_l1_cont(512 * 1024, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i3.offset, 2 * 1024 * 1024);
- ASSERT_EQ(i3.length, 512 * 1024);
+ ASSERT_EQ(i3.offset, 2u * 1024u * 1024u);
+ ASSERT_EQ(i3.length, 512u * 1024u);
i4 = al1.allocate_l1_cont(1536 * 1024, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i4.offset, (2 * 1024 + 512) * 1024 );
- ASSERT_EQ(i4.length, 1536 * 1024);
+ ASSERT_EQ(i4.offset, (2u * 1024u + 512u) * 1024u);
+ ASSERT_EQ(i4.length, 1536u * 1024u);
// making a hole 1.5 Mb length
al1.free_l1(i2);
al1.free_l1(i3);
// and trying to fill it
i2 = al1.allocate_l1_cont(1536 * 1024, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i2.offset, 1024 * 1024);
- ASSERT_EQ(i2.length, 1536 * 1024);
+ ASSERT_EQ(i2.offset, 1024u * 1024u);
+ ASSERT_EQ(i2.length, 1536u * 1024u);
al1.free_l1(i2);
// and trying to fill it partially
i2 = al1.allocate_l1_cont(1528 * 1024, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i2.offset, 1024 * 1024);
- ASSERT_EQ(i2.length, 1528 * 1024);
+ ASSERT_EQ(i2.offset, 1024u * 1024u);
+ ASSERT_EQ(i2.length, 1528u * 1024u);
i3 = al1.allocate_l1_cont(8 * 1024, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i3.offset, 2552 * 1024);
- ASSERT_EQ(i3.length, 8 * 1024);
+ ASSERT_EQ(i3.offset, 2552u * 1024u);
+ ASSERT_EQ(i3.length, 8u * 1024u);
al1.free_l1(i2);
// here we have the following layout:
// Free: 1M~1528K, 4M ~...
//
i2 = al1.allocate_l1_cont(1536 * 1024, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i2.offset, 4 * 1024 * 1024);
- ASSERT_EQ(i2.length, 1536 * 1024);
+ ASSERT_EQ(i2.offset, 4u * 1024u * 1024u);
+ ASSERT_EQ(i2.length, 1536u * 1024u);
al1.free_l1(i1);
al1.free_l1(i2);
ASSERT_EQ(i1.offset, i);
ASSERT_EQ(i1.length, _2m);
}
- ASSERT_EQ(0, al1.debug_get_free());
+ ASSERT_EQ(0u, al1.debug_get_free());
i2 = al1.allocate_l1_cont(_2m, _2m, 0, num_l1_entries);
- ASSERT_EQ(i2.length, 0);
- ASSERT_EQ(0, al1.debug_get_free());
+ ASSERT_EQ(i2.length, 0u);
+ ASSERT_EQ(0u, al1.debug_get_free());
al1.free_l1(i1);
i2 = al1.allocate_l1_cont(_2m, _2m, 0, num_l1_entries);
ASSERT_EQ(i2.length, _1m);
i3 = al1.allocate_l1_cont(_2m, _2m, 0, num_l1_entries);
- ASSERT_EQ(i3.length, 0);
+ ASSERT_EQ(i3.length, 0u);
i3 = al1.allocate_l1_cont(_2m, _1m, 0, num_l1_entries);
ASSERT_EQ(i3.length, _1m);
i4 = al1.allocate_l1_cont(_2m, _1m, 0, num_l1_entries);
- ASSERT_EQ(i4.length, 0);
+ ASSERT_EQ(i4.length, 0u);
al1.free_l1(i2);
i2 = al1.allocate_l1_cont(_2m, _2m, 0, num_l1_entries);
- ASSERT_EQ(i2.length, 0);
+ ASSERT_EQ(i2.length, 0u);
i2 = al1.allocate_l1_cont(_2m, 0x1000, 0, num_l1_entries);
ASSERT_EQ(i2.length, _1m);
i2 = al1.allocate_l1_cont(0x1000, 0x1000, 0, num_l1_entries);
i3 = al1.allocate_l1_cont(0x1000, 0x1000, 0, num_l1_entries);
i4 = al1.allocate_l1_cont(0x1000, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(0, al1.debug_get_free());
+ ASSERT_EQ(0u, al1.debug_get_free());
al1.free_l1(i2);
al1.free_l1(i4);
i2 = al1.allocate_l1_cont(0x4000, 0x2000, 0, num_l1_entries);
- ASSERT_EQ(i2.length, 0);
+ ASSERT_EQ(i2.length, 0u);
i2 = al1.allocate_l1_cont(0x4000, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i2.length, 0x1000);
+ ASSERT_EQ(i2.length, 0x1000u);
al1.free_l1(i3);
i3 = al1.allocate_l1_cont(0x6000, 0x3000, 0, num_l1_entries);
- ASSERT_EQ(i3.length, 0);
+ ASSERT_EQ(i3.length, 0u);
i3 = al1.allocate_l1_cont(0x6000, 0x1000, 0, num_l1_entries);
- ASSERT_EQ(i3.length, 0x2000);
- ASSERT_EQ(0, al1.debug_get_free());
+ ASSERT_EQ(i3.length, 0x2000u);
+ ASSERT_EQ(0u, al1.debug_get_free());
std::cout << "Done L1" << std::endl;
}
uint64_t allocated1 = 0;
interval_vector_t a1;
al2.allocate_l2(0x2000, 0x2000, &allocated1, &a1);
- ASSERT_EQ(allocated1, 0x2000);
- ASSERT_EQ(a1[0].offset, 0);
- ASSERT_EQ(a1[0].length, 0x2000);
+ ASSERT_EQ(allocated1, 0x2000u);
+ ASSERT_EQ(a1[0].offset, 0u);
+ ASSERT_EQ(a1[0].length, 0x2000u);
// limit query range in debug_get_free for the sake of performance
- ASSERT_EQ(0x2000, al2.debug_get_allocated(0, 1));
- ASSERT_EQ(0, al2.debug_get_allocated(1, 2));
+ ASSERT_EQ(0x2000u, al2.debug_get_allocated(0, 1));
+ ASSERT_EQ(0u, al2.debug_get_allocated(1, 2));
uint64_t allocated2 = 0;
interval_vector_t a2;
al2.allocate_l2(0x2000, 0x2000, &allocated2, &a2);
- ASSERT_EQ(allocated2, 0x2000);
- ASSERT_EQ(a2[0].offset, 0x2000);
- ASSERT_EQ(a2[0].length, 0x2000);
+ ASSERT_EQ(allocated2, 0x2000u);
+ ASSERT_EQ(a2[0].offset, 0x2000u);
+ ASSERT_EQ(a2[0].length, 0x2000u);
// limit query range in debug_get_free for the sake of performance
- ASSERT_EQ(0x4000, al2.debug_get_allocated(0, 1));
- ASSERT_EQ(0, al2.debug_get_allocated(1, 2));
+ ASSERT_EQ(0x4000u, al2.debug_get_allocated(0, 1));
+ ASSERT_EQ(0u, al2.debug_get_allocated(1, 2));
al2.free_l2(a1);
allocated2 = 0;
a2.clear();
al2.allocate_l2(0x1000, 0x1000, &allocated2, &a2);
- ASSERT_EQ(allocated2, 0x1000);
- ASSERT_EQ(a2[0].offset, 0x0000);
- ASSERT_EQ(a2[0].length, 0x1000);
+ ASSERT_EQ(allocated2, 0x1000u);
+ ASSERT_EQ(a2[0].offset, 0x0000u);
+ ASSERT_EQ(a2[0].length, 0x1000u);
// limit query range in debug_get_free for the sake of performance
- ASSERT_EQ(0x3000, al2.debug_get_allocated(0, 1));
- ASSERT_EQ(0, al2.debug_get_allocated(1, 2));
+ ASSERT_EQ(0x3000u, al2.debug_get_allocated(0, 1));
+ ASSERT_EQ(0u, al2.debug_get_allocated(1, 2));
uint64_t allocated3 = 0;
interval_vector_t a3;
al2.allocate_l2(0x2000, 0x1000, &allocated3, &a3);
- ASSERT_EQ(allocated3, 0x2000);
- ASSERT_EQ(a3.size(), 2);
- ASSERT_EQ(a3[0].offset, 0x1000);
- ASSERT_EQ(a3[0].length, 0x1000);
- ASSERT_EQ(a3[1].offset, 0x4000);
- ASSERT_EQ(a3[1].length, 0x1000);
+ ASSERT_EQ(allocated3, 0x2000u);
+ ASSERT_EQ(a3.size(), 2u);
+ ASSERT_EQ(a3[0].offset, 0x1000u);
+ ASSERT_EQ(a3[0].length, 0x1000u);
+ ASSERT_EQ(a3[1].offset, 0x4000u);
+ ASSERT_EQ(a3[1].length, 0x1000u);
// limit query range in debug_get_free for the sake of performance
- ASSERT_EQ(0x5000, al2.debug_get_allocated(0, 1));
- ASSERT_EQ(0, al2.debug_get_allocated(1, 2));
+ ASSERT_EQ(0x5000u, al2.debug_get_allocated(0, 1));
+ ASSERT_EQ(0u, al2.debug_get_allocated(1, 2));
{
interval_vector_t r;
r.emplace_back(0x0, 0x5000);
a3.clear();
allocated3 = 0;
al2.allocate_l2(_1m, _1m, &allocated3, &a3);
- ASSERT_EQ(a3.size(), 1);
- ASSERT_EQ(a3[0].offset, 0);
+ ASSERT_EQ(a3.size(), 1u);
+ ASSERT_EQ(a3[0].offset, 0u);
ASSERT_EQ(a3[0].length, _1m);
al2.free_l2(a3);
a3.clear();
allocated3 = 0;
al2.allocate_l2(4 * _1m, _1m, &allocated3, &a3);
- ASSERT_EQ(a3.size(), 1);
- ASSERT_EQ(a3[0].offset, 0);
+ ASSERT_EQ(a3.size(), 1u);
+ ASSERT_EQ(a3[0].offset, 0u);
ASSERT_EQ(a3[0].length, 4 * _1m);
al2.free_l2(a3);
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(0x1000, 0x1000, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 1);
+ ASSERT_EQ(a4.size(), 1u);
ASSERT_EQ(a4[0].offset, i);
- ASSERT_EQ(a4[0].length, 0x1000);
+ ASSERT_EQ(a4[0].length, 0x1000u);
if (0 == (i % (1 * 1024 * _1m))) {
std::cout << "alloc1 " << i / 1024 / 1024 << " mb of "
<< capacity / 1024 / 1024 << std::endl;
}
#endif
- ASSERT_EQ(0, al2.debug_get_free());
+ ASSERT_EQ(0u, al2.debug_get_free());
for (uint64_t i = 0; i < capacity; i += _1m) {
interval_vector_t r;
r.emplace_back(interval_t(i, _1m));
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(_1m, _1m, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 1);
+ ASSERT_EQ(a4.size(), 1u);
ASSERT_EQ(allocated4, _1m);
ASSERT_EQ(a4[0].offset, i);
ASSERT_EQ(a4[0].length, _1m);
<< capacity / 1024 / 1024 << std::endl;
}
}
- ASSERT_EQ(0, al2.debug_get_free());
+ ASSERT_EQ(0u, al2.debug_get_free());
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(_1m, _1m, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 0);
+ ASSERT_EQ(a4.size(), 0u);
al2.allocate_l2(0x1000, 0x1000, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 0);
+ ASSERT_EQ(a4.size(), 0u);
for (uint64_t i = 0; i < capacity; i += 0x2000) {
interval_vector_t r;
// unable to allocate due to fragmentation
al2.allocate_l2(_1m, _1m, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 0);
+ ASSERT_EQ(a4.size(), 0u);
for (uint64_t i = 0; i < capacity; i += 2 * _1m) {
a4.clear();
ASSERT_EQ(a4.size(), _1m / 0x1000);
ASSERT_EQ(allocated4, _1m);
ASSERT_EQ(a4[0].offset, i);
- ASSERT_EQ(a4[0].length, 0x1000);
+ ASSERT_EQ(a4[0].length, 0x1000u);
if (0 == (i % (1 * 1024 * _1m))) {
std::cout << "alloc3 " << i / 1024 / 1024 << " mb of "
<< capacity / 1024 / 1024 << std::endl;
}
}
- ASSERT_EQ(0, al2.debug_get_free());
+ ASSERT_EQ(0u, al2.debug_get_free());
std::cout << "Done L2" << std::endl;
}
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(0x1000, 0x1000, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 1);
- ASSERT_EQ(allocated4, 0x1000);
+ ASSERT_EQ(a4.size(), 1u);
+ ASSERT_EQ(allocated4, 0x1000u);
ASSERT_EQ(a4[0].offset, i);
- ASSERT_EQ(a4[0].length, 0x1000);
+ ASSERT_EQ(a4[0].length, 0x1000u);
allocated4 = 0;
a4.clear();
al2.allocate_l2(_1m - 0x1000, 0x1000, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 1);
+ ASSERT_EQ(a4.size(), 1u);
ASSERT_EQ(allocated4, _1m - 0x1000);
ASSERT_EQ(a4[0].offset, i + 0x1000);
ASSERT_EQ(a4[0].length, _1m - 0x1000);
uint64_t allocated = 0;
interval_vector_t a;
al2.allocate_l2(0x2000, 0x2000, &allocated, &a);
- ASSERT_EQ(a.size(), 0);
+ ASSERT_EQ(a.size(), 0u);
}
std::cout << "End try in " << time(NULL) - t << " seconds" << std::endl;
}
uint64_t allocated = 0;
interval_vector_t a;
al2.allocate_l2(_2m, _2m, &allocated, &a);
- ASSERT_EQ(a.size(), 0);
+ ASSERT_EQ(a.size(), 0u);
}
std::cout << "End try in " << time(NULL) - t << " seconds" << std::endl;
}
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(_1m / 2, _1m / 2, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 1);
+ ASSERT_EQ(a4.size(), 1u);
ASSERT_EQ(allocated4, _1m / 2);
ASSERT_EQ(a4[0].offset, i);
ASSERT_EQ(a4[0].length, _1m / 2);
<< capacity / 1024 / 1024 << std::endl;
}
}
- ASSERT_EQ(0, al2.debug_get_free());
+ ASSERT_EQ(0u, al2.debug_get_free());
{
// no space to allocate
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(0x1000, 0x1000, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 0);
+ ASSERT_EQ(a4.size(), 0u);
}
}
{
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(_1m / 2, _1m / 2, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 1);
+ ASSERT_EQ(a4.size(), 1u);
ASSERT_EQ(allocated4, _1m / 2);
ASSERT_EQ(a4[0].offset, i);
ASSERT_EQ(a4[0].length, _1m / 2);
<< capacity / 1024 / 1024 << std::endl;
}
}
- ASSERT_EQ(0, al2.debug_get_free());
+ ASSERT_EQ(0u, al2.debug_get_free());
{
// no space to allocate
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(0x1000, 0x1000, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 0);
+ ASSERT_EQ(a4.size(), 0u);
}
}
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(0x1000, 0x1000, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 1);
- ASSERT_EQ(allocated4, 0x1000);
+ ASSERT_EQ(a4.size(), 1u);
+ ASSERT_EQ(allocated4, 0x1000u);
ASSERT_EQ(a4[0].offset, i);
- ASSERT_EQ(a4[0].length, 0x1000);
+ ASSERT_EQ(a4[0].length, 0x1000u);
}
- ASSERT_EQ(0, al2.debug_get_free());
+ ASSERT_EQ(0u, al2.debug_get_free());
{
// no space to allocate
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(0x1000, 0x1000, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 0);
+ ASSERT_EQ(a4.size(), 0u);
}
}
{
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(0x1000, 0x1000, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 1);
- ASSERT_EQ(allocated4, 0x1000);
+ ASSERT_EQ(a4.size(), 1u);
+ ASSERT_EQ(allocated4, 0x1000u);
ASSERT_EQ(a4[0].offset, i);
- ASSERT_EQ(a4[0].length, 0x1000);
+ ASSERT_EQ(a4[0].length, 0x1000u);
}
- ASSERT_EQ(0, al2.debug_get_free());
+ ASSERT_EQ(0u, al2.debug_get_free());
{
// no space to allocate
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(0x1000, 0x1000, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 0);
+ ASSERT_EQ(a4.size(), 0u);
}
}
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(_1m, _1m, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 1);
+ ASSERT_EQ(a4.size(), 1u);
ASSERT_EQ(allocated4, _1m);
ASSERT_EQ(a4[0].offset, i);
ASSERT_EQ(a4[0].length, _1m);
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(0x1000, 0x1000, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 1);
- ASSERT_EQ(allocated4, 0x1000);
- ASSERT_EQ(a4[0].offset, 0);
- ASSERT_EQ(a4[0].length, 0x1000);
+ ASSERT_EQ(a4.size(), 1u);
+ ASSERT_EQ(allocated4, 0x1000u);
+ ASSERT_EQ(a4[0].offset, 0u);
+ ASSERT_EQ(a4[0].length, 0x1000u);
}
{
// allocate 1M - should go to the second 1M chunk
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(_1m, _1m, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 1);
+ ASSERT_EQ(a4.size(), 1u);
ASSERT_EQ(allocated4, _1m);
ASSERT_EQ(a4[0].offset, _1m);
ASSERT_EQ(a4[0].length, _1m);
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(0x2000, 0x1000, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 1);
- ASSERT_EQ(allocated4, 0x2000);
- ASSERT_EQ(a4[0].offset, 0x1000);
- ASSERT_EQ(a4[0].length, 0x2000);
+ ASSERT_EQ(a4.size(), 1u);
+ ASSERT_EQ(allocated4, 0x2000u);
+ ASSERT_EQ(a4[0].offset, 0x1000u);
+ ASSERT_EQ(a4[0].length, 0x2000u);
}
{
// release just allocated 1M
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(3 * _1m, _1m, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 2);
+ ASSERT_EQ(a4.size(), 2u);
ASSERT_EQ(allocated4, 3 * _1m);
ASSERT_EQ(a4[0].offset, _1m);
ASSERT_EQ(a4[0].length, _1m);
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(2 * _1m, _1m / 2, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 3);
+ ASSERT_EQ(a4.size(), 3u);
ASSERT_EQ(allocated4, 2 * _1m);
ASSERT_EQ(a4[0].offset, _1m / 2);
ASSERT_EQ(a4[0].length, _1m / 2);
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(132 * _1m, 4 * _1m , &allocated4, &a4);
- ASSERT_EQ(a4.size(), 1);
+ ASSERT_EQ(a4.size(), 1u);
ASSERT_EQ(a4[0].offset, capacity / 2);
ASSERT_EQ(a4[0].length, 132 * _1m);
}
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(132 * _1m, 2 * _1m , &allocated4, &a4);
- ASSERT_EQ(a4.size(), 2);
- ASSERT_EQ(a4[0].offset, 0);
+ ASSERT_EQ(a4.size(), 2u);
+ ASSERT_EQ(a4[0].offset, 0u);
ASSERT_EQ(a4[0].length, 2 * _1m);
ASSERT_EQ(a4[1].offset, capacity / 2);
ASSERT_EQ(a4[1].length, 130 * _1m);
uint64_t allocated4 = 0;
interval_vector_t a4;
al2.allocate_l2(0x8000, 0x4000, &allocated4, &a4);
- ASSERT_EQ(a4.size(), 2);
- ASSERT_EQ(a4[0].offset, 0x8000);
- ASSERT_EQ(a4[0].length, 0x4000);
+ ASSERT_EQ(a4.size(), 2u);
+ ASSERT_EQ(a4[0].offset, 0x8000u);
+ ASSERT_EQ(a4[0].length, 0x4000u);
ASSERT_EQ(a4[1].offset, capacity / 2);
- ASSERT_EQ(a4[1].length, 0x4000);
+ ASSERT_EQ(a4[1].length, 0x4000u);
}
}