diff options
Diffstat (limited to 'src/include/executor')
-rw-r--r-- | src/include/executor/tuptable.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/include/executor/tuptable.h b/src/include/executor/tuptable.h index a044d78e4d0..095e4cc82e3 100644 --- a/src/include/executor/tuptable.h +++ b/src/include/executor/tuptable.h @@ -218,8 +218,12 @@ struct TupleTableSlotOps * meaningful "system columns" in the copy. The copy is not be "owned" by * the slot i.e. the caller has to take responsibility to free memory * consumed by the slot. + * + * The copy has "extra" bytes (maxaligned and zeroed) available before the + * tuple, which is useful so that some callers may store extra data along + * with the minimal tuple without the need for an additional allocation. */ - MinimalTuple (*copy_minimal_tuple) (TupleTableSlot *slot); + MinimalTuple (*copy_minimal_tuple) (TupleTableSlot *slot, Size extra); }; /* @@ -491,7 +495,19 @@ ExecCopySlotHeapTuple(TupleTableSlot *slot) static inline MinimalTuple ExecCopySlotMinimalTuple(TupleTableSlot *slot) { - return slot->tts_ops->copy_minimal_tuple(slot); + return slot->tts_ops->copy_minimal_tuple(slot, 0); +} + +/* + * ExecCopySlotMinimalTupleExtra - return MinimalTuple allocated in caller's + * context, with extra bytes (maxaligned and zeroed) before the tuple for data + * the caller wishes to store along with the tuple (without requiring the + * caller to make an additional allocation). + */ +static inline MinimalTuple +ExecCopySlotMinimalTupleExtra(TupleTableSlot *slot, Size extra) +{ + return slot->tts_ops->copy_minimal_tuple(slot, extra); } /* |