MCPcopy Create free account
hub / github.com/apache/impala / AssertMemoryValid

Method AssertMemoryValid

be/src/runtime/bufferpool/suballocator-test.cc:352–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352void SuballocatorTest::AssertMemoryValid(
353 const vector<unique_ptr<Suballocation>>& allocs) {
354 for (int64_t i = 0; i < allocs.size(); ++i) {
355 const unique_ptr<Suballocation>& alloc = allocs[i];
356 ASSERT_GE(alloc->len(), 8);
357 // Memory should be 8-byte aligned.
358 ASSERT_EQ(0, reinterpret_cast<uint64_t>(alloc->data()) % 8) << alloc->data();
359 for (int64_t offset = 0; offset < alloc->len(); offset += 8) {
360 *reinterpret_cast<int64_t*>(alloc->data() + offset) = i;
361 }
362 }
363 for (int64_t i = 0; i < allocs.size(); ++i) {
364 const unique_ptr<Suballocation>& alloc = allocs[i];
365 for (int64_t offset = 0; offset < alloc->len(); offset += 8) {
366 ASSERT_EQ(*reinterpret_cast<int64_t*>(alloc->data() + offset), i)
367 << i << " " << alloc->data() << " " << offset;
368 }
369 }
370}
371}

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
lenMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected