MCPcopy Create free account
hub / github.com/apple/foundationdb / coalesceOver

Method coalesceOver

fdbclient/WriteMap.cpp:480–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478}
479
480void WriteMap::coalesceOver(OperationStack& stack, RYWMutation newEntry, Arena& arena) {
481 RYWMutation existingEntry = stack.top();
482 if (existingEntry.type == newEntry.type && newEntry.type != MutationRef::CompareAndClear) {
483 if (isNonAssociativeOp(existingEntry.type) && existingEntry.value.present() &&
484 existingEntry.value.get().size() != newEntry.value.get().size()) {
485 stack.push(newEntry);
486 } else {
487 stack.poppush(coalesce(existingEntry, newEntry, arena));
488 }
489 } else {
490 if (isAtomicOp(newEntry.type) && isAtomicOp(existingEntry.type)) {
491 stack.push(newEntry);
492 } else {
493 stack.poppush(coalesce(existingEntry, newEntry, arena));
494 }
495 }
496}
497
498RYWMutation WriteMap::coalesceUnder(OperationStack const& stack, Optional<ValueRef> const& value, Arena& arena) {
499 if (!stack.isDependent() && stack.size() == 1)

Callers

nothing calls this directly

Calls 7

isNonAssociativeOpFunction · 0.85
isAtomicOpFunction · 0.85
poppushMethod · 0.80
getMethod · 0.65
presentMethod · 0.45
sizeMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected