热点函数替换memcpy_sp和添加inline函数

This commit is contained in:
yyl164119487
2023-07-12 14:38:47 +08:00
parent 30e029faa7
commit e99f2b8aec
11 changed files with 102 additions and 93 deletions

View File

@ -196,7 +196,33 @@ extern TupleTableSlot* ExecStoreDataRowTuple(
#endif
extern TupleTableSlot* ExecClearTuple(TupleTableSlot* slot);
extern void ExecClearMutilTuple(List* slots);
extern TupleTableSlot* ExecStoreVirtualTuple(TupleTableSlot* slot);
/* --------------------------------
* ExecStoreVirtualTuple
* Mark a slot as containing a virtual tuple.
*
* The protocol for loading a slot with virtual tuple data is:
* * Call ExecClearTuple to mark the slot empty.
* * Store data into the Datum/isnull arrays.
* * Call ExecStoreVirtualTuple to mark the slot valid.
* This is a bit unclean but it avoids one round of data copying.
* --------------------------------
*/
inline TupleTableSlot* ExecStoreVirtualTuple(TupleTableSlot* slot)
{
/*
* sanity checks
*/
Assert(slot != NULL);
Assert(slot->tts_tupleDescriptor != NULL);
Assert(TTS_EMPTY(slot));
slot->tts_flags &= ~TTS_FLAG_EMPTY;
slot->tts_nvalid = slot->tts_tupleDescriptor->natts;
return slot;
}
extern TupleTableSlot* ExecStoreAllNullTuple(TupleTableSlot* slot);
extern HeapTuple ExecCopySlotTuple(TupleTableSlot* slot);
extern MinimalTuple ExecCopySlotMinimalTuple(TupleTableSlot* slot, bool need_transform_anyarray = false);