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

Function DecreaseBytesRemaining

be/src/runtime/bufferpool/buffer-allocator.cc:373–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371}
372
373int64_t DecreaseBytesRemaining(
374 int64_t max_decrease, bool require_full_decrease, AtomicInt64* bytes_remaining) {
375 while (true) {
376 int64_t old_value = bytes_remaining->Load();
377 if (require_full_decrease && old_value < max_decrease) return 0;
378 int64_t decrease = min(old_value, max_decrease);
379 int64_t new_value = old_value - decrease;
380 if (bytes_remaining->CompareAndSwap(old_value, new_value)) {
381 return decrease;
382 }
383 }
384}
385
386int64_t BufferPool::BufferAllocator::ScavengeBuffers(
387 bool slow_but_sure, int current_core, int64_t target_bytes) {

Callers 3

AllocateInternalMethod · 0.85
ScavengeBuffersMethod · 0.85
AddCleanPageMethod · 0.85

Calls 3

minFunction · 0.85
LoadMethod · 0.45
CompareAndSwapMethod · 0.45

Tested by

no test coverage detected