MCPcopy Create free account
hub / github.com/baidu/babylon / TEST

Function TEST

test/reusable/test_page_allocator.cpp:34–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32static size_t kernel_page_size = ::sysconf(_SC_PAGESIZE);
33
34TEST(system_page_allocator, allocate_valid_page) {
35 SystemPageAllocator& allocator = SystemPageAllocator::instance();
36 ASSERT_EQ(kernel_page_size, allocator.page_size());
37 void* page = allocator.allocate();
38 ASSERT_EQ(0, reinterpret_cast<uintptr_t>(page) % kernel_page_size);
39 ::memset(page, 0, kernel_page_size);
40 allocator.deallocate(page);
41}
42
43TEST(cached_page_allocator, proxy_page_size_to_upstream) {
44 NewDeletePageAllocator upstream_allocator;

Callers

nothing calls this directly

Calls 14

page_sizeMethod · 0.80
cache_hit_summaryMethod · 0.80
free_page_numMethod · 0.80
set_batch_sizeMethod · 0.80
emplace_backMethod · 0.80
allocate_page_numMethod · 0.80
free_page_capacityMethod · 0.80
allocateMethod · 0.45
deallocateMethod · 0.45
set_page_sizeMethod · 0.45
set_upstreamMethod · 0.45

Tested by

no test coverage detected