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

Method CheckAllocatedArea

cpp/src/arrow/memory_pool.cc:279–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277 }
278
279 static void CheckAllocatedArea(uint8_t* ptr, int64_t size, const char* context) {
280 // Check that memory wasn't clobbered at the end of the allocated area.
281 int64_t stored_size =
282 memory_pool::internal::kDebugXorSuffix ^ util::SafeLoadAs<int64_t>(ptr + size);
283 if (ARROW_PREDICT_FALSE(stored_size != size)) {
284 auto st = Status::Invalid("Wrong size on ", context, ": given size = ", size,
285 ", actual size = ", stored_size);
286 DebugState::Instance()->Invoke(ptr, size, st);
287 }
288 }
289
290 static constexpr int64_t kOverhead = sizeof(int64_t);
291};

Callers

nothing calls this directly

Calls 2

InvalidFunction · 0.70
InvokeMethod · 0.45

Tested by

no test coverage detected