MCPcopy Create free account
hub / github.com/apache/arrow / TestOOM

Method TestOOM

cpp/src/arrow/memory_pool_test.h:57–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55 }
56
57 void TestOOM() {
58 auto pool = memory_pool();
59
60 uint8_t* data;
61 int64_t max_alloc = std::min<uint64_t>(std::numeric_limits<int64_t>::max(),
62 std::numeric_limits<size_t>::max());
63 // subtract 63 to prevent overflow after the size is aligned
64 for (int64_t to_alloc : {max_alloc, max_alloc - 63, max_alloc - 127}) {
65 ASSERT_RAISES(OutOfMemory, pool->Allocate(to_alloc, &data));
66 }
67 }
68
69 void TestReallocate() {
70 auto pool = memory_pool();

Callers 2

TYPED_TEST_PFunction · 0.80
TEST_FFunction · 0.80

Calls 2

memory_poolFunction · 0.50
AllocateMethod · 0.45

Tested by

no test coverage detected