PostgreSQL Source Code  git master
resowner_private.h File Reference
#include "storage/dsm.h"
#include "storage/fd.h"
#include "storage/lock.h"
#include "utils/catcache.h"
#include "utils/plancache.h"
#include "utils/resowner.h"
#include "utils/snapshot.h"
Include dependency graph for resowner_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void ResourceOwnerEnlargeBuffers (ResourceOwner owner)
 
void ResourceOwnerRememberBuffer (ResourceOwner owner, Buffer buffer)
 
void ResourceOwnerForgetBuffer (ResourceOwner owner, Buffer buffer)
 
void ResourceOwnerRememberLock (ResourceOwner owner, LOCALLOCK *locallock)
 
void ResourceOwnerForgetLock (ResourceOwner owner, LOCALLOCK *locallock)
 
void ResourceOwnerEnlargeCatCacheRefs (ResourceOwner owner)
 
void ResourceOwnerRememberCatCacheRef (ResourceOwner owner, HeapTuple tuple)
 
void ResourceOwnerForgetCatCacheRef (ResourceOwner owner, HeapTuple tuple)
 
void ResourceOwnerEnlargeCatCacheListRefs (ResourceOwner owner)
 
void ResourceOwnerRememberCatCacheListRef (ResourceOwner owner, CatCList *list)
 
void ResourceOwnerForgetCatCacheListRef (ResourceOwner owner, CatCList *list)
 
void ResourceOwnerEnlargeRelationRefs (ResourceOwner owner)
 
void ResourceOwnerRememberRelationRef (ResourceOwner owner, Relation rel)
 
void ResourceOwnerForgetRelationRef (ResourceOwner owner, Relation rel)
 
void ResourceOwnerEnlargePlanCacheRefs (ResourceOwner owner)
 
void ResourceOwnerRememberPlanCacheRef (ResourceOwner owner, CachedPlan *plan)
 
void ResourceOwnerForgetPlanCacheRef (ResourceOwner owner, CachedPlan *plan)
 
void ResourceOwnerEnlargeTupleDescs (ResourceOwner owner)
 
void ResourceOwnerRememberTupleDesc (ResourceOwner owner, TupleDesc tupdesc)
 
void ResourceOwnerForgetTupleDesc (ResourceOwner owner, TupleDesc tupdesc)
 
void ResourceOwnerEnlargeSnapshots (ResourceOwner owner)
 
void ResourceOwnerRememberSnapshot (ResourceOwner owner, Snapshot snapshot)
 
void ResourceOwnerForgetSnapshot (ResourceOwner owner, Snapshot snapshot)
 
void ResourceOwnerEnlargeFiles (ResourceOwner owner)
 
void ResourceOwnerRememberFile (ResourceOwner owner, File file)
 
void ResourceOwnerForgetFile (ResourceOwner owner, File file)
 
void ResourceOwnerEnlargeDSMs (ResourceOwner owner)
 
void ResourceOwnerRememberDSM (ResourceOwner owner, dsm_segment *)
 
void ResourceOwnerForgetDSM (ResourceOwner owner, dsm_segment *)
 
void ResourceOwnerEnlargeJIT (ResourceOwner owner)
 
void ResourceOwnerRememberJIT (ResourceOwner owner, Datum handle)
 
void ResourceOwnerForgetJIT (ResourceOwner owner, Datum handle)
 

Function Documentation

◆ ResourceOwnerEnlargeBuffers()

void ResourceOwnerEnlargeBuffers ( ResourceOwner  owner)

Definition at line 838 of file resowner.c.

References ResourceOwnerData::bufferarr, and ResourceArrayEnlarge().

Referenced by BgBufferSync(), BufferSync(), FlushDatabaseBuffers(), FlushRelationBuffers(), IncrBufferRefCount(), and ReadBuffer_common().

839 {
840  if (owner == NULL)
841  return;
842  ResourceArrayEnlarge(&(owner->bufferarr));
843 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:204
ResourceArray bufferarr
Definition: resowner.c:119

◆ ResourceOwnerEnlargeCatCacheListRefs()

void ResourceOwnerEnlargeCatCacheListRefs ( ResourceOwner  owner)

Definition at line 972 of file resowner.c.

References ResourceOwnerData::catlistrefarr, and ResourceArrayEnlarge().

Referenced by SearchCatCacheList().

973 {
975 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:204
ResourceArray catlistrefarr
Definition: resowner.c:121

◆ ResourceOwnerEnlargeCatCacheRefs()

void ResourceOwnerEnlargeCatCacheRefs ( ResourceOwner  owner)

Definition at line 937 of file resowner.c.

References ResourceOwnerData::catrefarr, and ResourceArrayEnlarge().

Referenced by SearchCatCacheInternal(), and SearchCatCacheMiss().

938 {
939  ResourceArrayEnlarge(&(owner->catrefarr));
940 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:204
ResourceArray catrefarr
Definition: resowner.c:120

◆ ResourceOwnerEnlargeDSMs()

void ResourceOwnerEnlargeDSMs ( ResourceOwner  owner)

Definition at line 1233 of file resowner.c.

References ResourceOwnerData::dsmarr, and ResourceArrayEnlarge().

Referenced by dsm_create_descriptor(), and dsm_unpin_mapping().

1234 {
1235  ResourceArrayEnlarge(&(owner->dsmarr));
1236 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:204
ResourceArray dsmarr
Definition: resowner.c:127

◆ ResourceOwnerEnlargeFiles()

void ResourceOwnerEnlargeFiles ( ResourceOwner  owner)

Definition at line 1188 of file resowner.c.

References ResourceOwnerData::filearr, and ResourceArrayEnlarge().

Referenced by OpenTemporaryFile(), PathNameCreateTemporaryFile(), and PathNameOpenTemporaryFile().

1189 {
1190  ResourceArrayEnlarge(&(owner->filearr));
1191 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:204
ResourceArray filearr
Definition: resowner.c:126

◆ ResourceOwnerEnlargeJIT()

void ResourceOwnerEnlargeJIT ( ResourceOwner  owner)

Definition at line 1278 of file resowner.c.

References ResourceOwnerData::jitarr, and ResourceArrayEnlarge().

Referenced by llvm_create_context().

1279 {
1280  ResourceArrayEnlarge(&(owner->jitarr));
1281 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:204
ResourceArray jitarr
Definition: resowner.c:128

◆ ResourceOwnerEnlargePlanCacheRefs()

void ResourceOwnerEnlargePlanCacheRefs ( ResourceOwner  owner)

Definition at line 1052 of file resowner.c.

References ResourceOwnerData::planrefarr, and ResourceArrayEnlarge().

Referenced by GetCachedPlan().

1053 {
1054  ResourceArrayEnlarge(&(owner->planrefarr));
1055 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:204
ResourceArray planrefarr
Definition: resowner.c:123

◆ ResourceOwnerEnlargeRelationRefs()

void ResourceOwnerEnlargeRelationRefs ( ResourceOwner  owner)

Definition at line 1007 of file resowner.c.

References ResourceOwnerData::relrefarr, and ResourceArrayEnlarge().

Referenced by RelationIncrementReferenceCount().

1008 {
1009  ResourceArrayEnlarge(&(owner->relrefarr));
1010 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:204
ResourceArray relrefarr
Definition: resowner.c:122

◆ ResourceOwnerEnlargeSnapshots()

void ResourceOwnerEnlargeSnapshots ( ResourceOwner  owner)

Definition at line 1142 of file resowner.c.

References ResourceArrayEnlarge(), and ResourceOwnerData::snapshotarr.

Referenced by RegisterSnapshotOnOwner().

1143 {
1144  ResourceArrayEnlarge(&(owner->snapshotarr));
1145 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:204
ResourceArray snapshotarr
Definition: resowner.c:125

◆ ResourceOwnerEnlargeTupleDescs()

void ResourceOwnerEnlargeTupleDescs ( ResourceOwner  owner)

Definition at line 1096 of file resowner.c.

References ResourceArrayEnlarge(), and ResourceOwnerData::tupdescarr.

Referenced by IncrTupleDescRefCount().

1097 {
1098  ResourceArrayEnlarge(&(owner->tupdescarr));
1099 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:204
ResourceArray tupdescarr
Definition: resowner.c:124

◆ ResourceOwnerForgetBuffer()

void ResourceOwnerForgetBuffer ( ResourceOwner  owner,
Buffer  buffer 
)

Definition at line 868 of file resowner.c.

References ResourceOwnerData::bufferarr, BufferGetDatum, elog, ERROR, ResourceOwnerData::name, and ResourceArrayRemove().

Referenced by ReleaseAndReadBuffer(), ReleaseBuffer(), and UnpinBuffer().

869 {
870  if (owner == NULL)
871  return;
873  elog(ERROR, "buffer %d is not owned by resource owner %s",
874  buffer, owner->name);
875 }
ResourceArray bufferarr
Definition: resowner.c:119
const char * name
Definition: resowner.c:116
#define ERROR
Definition: elog.h:43
#define BufferGetDatum(buffer)
Definition: resowner.c:42
WalTimeSample buffer[LAG_TRACKER_BUFFER_SIZE]
Definition: walsender.c:215
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:297
#define elog
Definition: elog.h:219

◆ ResourceOwnerForgetCatCacheListRef()

void ResourceOwnerForgetCatCacheListRef ( ResourceOwner  owner,
CatCList list 
)

Definition at line 992 of file resowner.c.

References ResourceOwnerData::catlistrefarr, elog, ERROR, ResourceOwnerData::name, PointerGetDatum, and ResourceArrayRemove().

Referenced by ReleaseCatCacheList().

993 {
994  if (!ResourceArrayRemove(&(owner->catlistrefarr), PointerGetDatum(list)))
995  elog(ERROR, "catcache list reference %p is not owned by resource owner %s",
996  list, owner->name);
997 }
#define PointerGetDatum(X)
Definition: postgres.h:541
const char * name
Definition: resowner.c:116
#define ERROR
Definition: elog.h:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:297
ResourceArray catlistrefarr
Definition: resowner.c:121
#define elog
Definition: elog.h:219

◆ ResourceOwnerForgetCatCacheRef()

void ResourceOwnerForgetCatCacheRef ( ResourceOwner  owner,
HeapTuple  tuple 
)

Definition at line 957 of file resowner.c.

References ResourceOwnerData::catrefarr, elog, ERROR, ResourceOwnerData::name, PointerGetDatum, and ResourceArrayRemove().

Referenced by ReleaseCatCache().

958 {
959  if (!ResourceArrayRemove(&(owner->catrefarr), PointerGetDatum(tuple)))
960  elog(ERROR, "catcache reference %p is not owned by resource owner %s",
961  tuple, owner->name);
962 }
ResourceArray catrefarr
Definition: resowner.c:120
#define PointerGetDatum(X)
Definition: postgres.h:541
const char * name
Definition: resowner.c:116
#define ERROR
Definition: elog.h:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:297
#define elog
Definition: elog.h:219

◆ ResourceOwnerForgetDSM()

void ResourceOwnerForgetDSM ( ResourceOwner  owner,
dsm_segment  
)

Definition at line 1253 of file resowner.c.

References dsm_segment_handle(), ResourceOwnerData::dsmarr, elog, ERROR, ResourceOwnerData::name, PointerGetDatum, and ResourceArrayRemove().

Referenced by dsm_create(), dsm_detach(), and dsm_pin_mapping().

1254 {
1255  if (!ResourceArrayRemove(&(owner->dsmarr), PointerGetDatum(seg)))
1256  elog(ERROR, "dynamic shared memory segment %u is not owned by resource owner %s",
1257  dsm_segment_handle(seg), owner->name);
1258 }
#define PointerGetDatum(X)
Definition: postgres.h:541
dsm_handle dsm_segment_handle(dsm_segment *seg)
Definition: dsm.c:1015
const char * name
Definition: resowner.c:116
#define ERROR
Definition: elog.h:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:297
ResourceArray dsmarr
Definition: resowner.c:127
#define elog
Definition: elog.h:219

◆ ResourceOwnerForgetFile()

void ResourceOwnerForgetFile ( ResourceOwner  owner,
File  file 
)

Definition at line 1208 of file resowner.c.

References elog, ERROR, ResourceOwnerData::filearr, FileGetDatum, ResourceOwnerData::name, and ResourceArrayRemove().

Referenced by FileClose().

1209 {
1210  if (!ResourceArrayRemove(&(owner->filearr), FileGetDatum(file)))
1211  elog(ERROR, "temporary file %d is not owned by resource owner %s",
1212  file, owner->name);
1213 }
const char * name
Definition: resowner.c:116
#define ERROR
Definition: elog.h:43
#define FileGetDatum(file)
Definition: resowner.c:40
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:297
#define elog
Definition: elog.h:219
ResourceArray filearr
Definition: resowner.c:126

◆ ResourceOwnerForgetJIT()

void ResourceOwnerForgetJIT ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1298 of file resowner.c.

References DatumGetPointer, elog, ERROR, ResourceOwnerData::jitarr, ResourceOwnerData::name, and ResourceArrayRemove().

Referenced by jit_release_context().

1299 {
1300  if (!ResourceArrayRemove(&(owner->jitarr), handle))
1301  elog(ERROR, "JIT context %p is not owned by resource owner %s",
1302  DatumGetPointer(handle), owner->name);
1303 }
const char * name
Definition: resowner.c:116
#define ERROR
Definition: elog.h:43
ResourceArray jitarr
Definition: resowner.c:128
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:297
#define DatumGetPointer(X)
Definition: postgres.h:534
#define elog
Definition: elog.h:219

◆ ResourceOwnerForgetLock()

void ResourceOwnerForgetLock ( ResourceOwner  owner,
LOCALLOCK locallock 
)

Definition at line 908 of file resowner.c.

References Assert, elog, ERROR, i, ResourceOwnerData::locks, MAX_RESOWNER_LOCKS, ResourceOwnerData::name, and ResourceOwnerData::nlocks.

Referenced by LockReassignOwner(), LockRelease(), LockReleaseAll(), ReleaseLockIfHeld(), and RemoveLocalLock().

909 {
910  int i;
911 
912  if (owner->nlocks > MAX_RESOWNER_LOCKS)
913  return; /* we have overflowed */
914 
915  Assert(owner->nlocks > 0);
916  for (i = owner->nlocks - 1; i >= 0; i--)
917  {
918  if (locallock == owner->locks[i])
919  {
920  owner->locks[i] = owner->locks[owner->nlocks - 1];
921  owner->nlocks--;
922  return;
923  }
924  }
925  elog(ERROR, "lock reference %p is not owned by resource owner %s",
926  locallock, owner->name);
927 }
#define MAX_RESOWNER_LOCKS
Definition: resowner.c:106
const char * name
Definition: resowner.c:116
#define ERROR
Definition: elog.h:43
#define Assert(condition)
Definition: c.h:699
LOCALLOCK * locks[MAX_RESOWNER_LOCKS]
Definition: resowner.c:132
int i
#define elog
Definition: elog.h:219

◆ ResourceOwnerForgetPlanCacheRef()

void ResourceOwnerForgetPlanCacheRef ( ResourceOwner  owner,
CachedPlan plan 
)

Definition at line 1072 of file resowner.c.

References elog, ERROR, ResourceOwnerData::name, ResourceOwnerData::planrefarr, PointerGetDatum, and ResourceArrayRemove().

Referenced by ReleaseCachedPlan().

1073 {
1074  if (!ResourceArrayRemove(&(owner->planrefarr), PointerGetDatum(plan)))
1075  elog(ERROR, "plancache reference %p is not owned by resource owner %s",
1076  plan, owner->name);
1077 }
#define PointerGetDatum(X)
Definition: postgres.h:541
const char * name
Definition: resowner.c:116
#define ERROR
Definition: elog.h:43
ResourceArray planrefarr
Definition: resowner.c:123
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:297
#define elog
Definition: elog.h:219

◆ ResourceOwnerForgetRelationRef()

void ResourceOwnerForgetRelationRef ( ResourceOwner  owner,
Relation  rel 
)

Definition at line 1027 of file resowner.c.

References elog, ERROR, ResourceOwnerData::name, PointerGetDatum, RelationGetRelationName, ResourceOwnerData::relrefarr, and ResourceArrayRemove().

Referenced by RelationDecrementReferenceCount().

1028 {
1029  if (!ResourceArrayRemove(&(owner->relrefarr), PointerGetDatum(rel)))
1030  elog(ERROR, "relcache reference %s is not owned by resource owner %s",
1031  RelationGetRelationName(rel), owner->name);
1032 }
ResourceArray relrefarr
Definition: resowner.c:122
#define PointerGetDatum(X)
Definition: postgres.h:541
const char * name
Definition: resowner.c:116
#define ERROR
Definition: elog.h:43
#define RelationGetRelationName(relation)
Definition: rel.h:441
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:297
#define elog
Definition: elog.h:219

◆ ResourceOwnerForgetSnapshot()

void ResourceOwnerForgetSnapshot ( ResourceOwner  owner,
Snapshot  snapshot 
)

Definition at line 1162 of file resowner.c.

References elog, ERROR, ResourceOwnerData::name, PointerGetDatum, ResourceArrayRemove(), and ResourceOwnerData::snapshotarr.

Referenced by UnregisterSnapshotFromOwner().

1163 {
1164  if (!ResourceArrayRemove(&(owner->snapshotarr), PointerGetDatum(snapshot)))
1165  elog(ERROR, "snapshot reference %p is not owned by resource owner %s",
1166  snapshot, owner->name);
1167 }
#define PointerGetDatum(X)
Definition: postgres.h:541
ResourceArray snapshotarr
Definition: resowner.c:125
const char * name
Definition: resowner.c:116
#define ERROR
Definition: elog.h:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:297
#define elog
Definition: elog.h:219

◆ ResourceOwnerForgetTupleDesc()

void ResourceOwnerForgetTupleDesc ( ResourceOwner  owner,
TupleDesc  tupdesc 
)

Definition at line 1116 of file resowner.c.

References elog, ERROR, ResourceOwnerData::name, PointerGetDatum, ResourceArrayRemove(), and ResourceOwnerData::tupdescarr.

Referenced by DecrTupleDescRefCount().

1117 {
1118  if (!ResourceArrayRemove(&(owner->tupdescarr), PointerGetDatum(tupdesc)))
1119  elog(ERROR, "tupdesc reference %p is not owned by resource owner %s",
1120  tupdesc, owner->name);
1121 }
#define PointerGetDatum(X)
Definition: postgres.h:541
const char * name
Definition: resowner.c:116
#define ERROR
Definition: elog.h:43
ResourceArray tupdescarr
Definition: resowner.c:124
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:297
#define elog
Definition: elog.h:219

◆ ResourceOwnerRememberBuffer()

void ResourceOwnerRememberBuffer ( ResourceOwner  owner,
Buffer  buffer 
)

Definition at line 854 of file resowner.c.

References ResourceOwnerData::bufferarr, BufferGetDatum, and ResourceArrayAdd().

Referenced by IncrBufferRefCount(), LocalBufferAlloc(), PinBuffer(), and PinBuffer_Locked().

855 {
856  if (owner == NULL)
857  return;
859 }
ResourceArray bufferarr
Definition: resowner.c:119
#define BufferGetDatum(buffer)
Definition: resowner.c:42
WalTimeSample buffer[LAG_TRACKER_BUFFER_SIZE]
Definition: walsender.c:215
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:259

◆ ResourceOwnerRememberCatCacheListRef()

void ResourceOwnerRememberCatCacheListRef ( ResourceOwner  owner,
CatCList list 
)

Definition at line 983 of file resowner.c.

References ResourceOwnerData::catlistrefarr, PointerGetDatum, and ResourceArrayAdd().

Referenced by SearchCatCacheList().

984 {
986 }
#define PointerGetDatum(X)
Definition: postgres.h:541
ResourceArray catlistrefarr
Definition: resowner.c:121
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:259

◆ ResourceOwnerRememberCatCacheRef()

void ResourceOwnerRememberCatCacheRef ( ResourceOwner  owner,
HeapTuple  tuple 
)

Definition at line 948 of file resowner.c.

References ResourceOwnerData::catrefarr, PointerGetDatum, and ResourceArrayAdd().

Referenced by SearchCatCacheInternal(), and SearchCatCacheMiss().

949 {
950  ResourceArrayAdd(&(owner->catrefarr), PointerGetDatum(tuple));
951 }
ResourceArray catrefarr
Definition: resowner.c:120
#define PointerGetDatum(X)
Definition: postgres.h:541
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:259

◆ ResourceOwnerRememberDSM()

void ResourceOwnerRememberDSM ( ResourceOwner  owner,
dsm_segment  
)

Definition at line 1244 of file resowner.c.

References ResourceOwnerData::dsmarr, PointerGetDatum, and ResourceArrayAdd().

Referenced by dsm_create_descriptor(), and dsm_unpin_mapping().

1245 {
1246  ResourceArrayAdd(&(owner->dsmarr), PointerGetDatum(seg));
1247 }
#define PointerGetDatum(X)
Definition: postgres.h:541
ResourceArray dsmarr
Definition: resowner.c:127
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:259

◆ ResourceOwnerRememberFile()

void ResourceOwnerRememberFile ( ResourceOwner  owner,
File  file 
)

Definition at line 1199 of file resowner.c.

References ResourceOwnerData::filearr, FileGetDatum, and ResourceArrayAdd().

Referenced by RegisterTemporaryFile().

1200 {
1201  ResourceArrayAdd(&(owner->filearr), FileGetDatum(file));
1202 }
#define FileGetDatum(file)
Definition: resowner.c:40
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:259
ResourceArray filearr
Definition: resowner.c:126

◆ ResourceOwnerRememberJIT()

void ResourceOwnerRememberJIT ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1289 of file resowner.c.

References ResourceOwnerData::jitarr, and ResourceArrayAdd().

Referenced by llvm_create_context().

1290 {
1291  ResourceArrayAdd(&(owner->jitarr), handle);
1292 }
ResourceArray jitarr
Definition: resowner.c:128
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:259

◆ ResourceOwnerRememberLock()

void ResourceOwnerRememberLock ( ResourceOwner  owner,
LOCALLOCK locallock 
)

Definition at line 888 of file resowner.c.

References Assert, ResourceOwnerData::locks, MAX_RESOWNER_LOCKS, and ResourceOwnerData::nlocks.

Referenced by GrantLockLocal(), and LockReassignOwner().

889 {
890  Assert(locallock != NULL);
891 
892  if (owner->nlocks > MAX_RESOWNER_LOCKS)
893  return; /* we have already overflowed */
894 
895  if (owner->nlocks < MAX_RESOWNER_LOCKS)
896  owner->locks[owner->nlocks] = locallock;
897  else
898  {
899  /* overflowed */
900  }
901  owner->nlocks++;
902 }
#define MAX_RESOWNER_LOCKS
Definition: resowner.c:106
#define Assert(condition)
Definition: c.h:699
LOCALLOCK * locks[MAX_RESOWNER_LOCKS]
Definition: resowner.c:132

◆ ResourceOwnerRememberPlanCacheRef()

void ResourceOwnerRememberPlanCacheRef ( ResourceOwner  owner,
CachedPlan plan 
)

Definition at line 1063 of file resowner.c.

References ResourceOwnerData::planrefarr, PointerGetDatum, and ResourceArrayAdd().

Referenced by GetCachedPlan().

1064 {
1065  ResourceArrayAdd(&(owner->planrefarr), PointerGetDatum(plan));
1066 }
#define PointerGetDatum(X)
Definition: postgres.h:541
ResourceArray planrefarr
Definition: resowner.c:123
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:259

◆ ResourceOwnerRememberRelationRef()

void ResourceOwnerRememberRelationRef ( ResourceOwner  owner,
Relation  rel 
)

Definition at line 1018 of file resowner.c.

References PointerGetDatum, ResourceOwnerData::relrefarr, and ResourceArrayAdd().

Referenced by RelationIncrementReferenceCount().

1019 {
1020  ResourceArrayAdd(&(owner->relrefarr), PointerGetDatum(rel));
1021 }
ResourceArray relrefarr
Definition: resowner.c:122
#define PointerGetDatum(X)
Definition: postgres.h:541
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:259

◆ ResourceOwnerRememberSnapshot()

void ResourceOwnerRememberSnapshot ( ResourceOwner  owner,
Snapshot  snapshot 
)

Definition at line 1153 of file resowner.c.

References PointerGetDatum, ResourceArrayAdd(), and ResourceOwnerData::snapshotarr.

Referenced by RegisterSnapshotOnOwner().

1154 {
1155  ResourceArrayAdd(&(owner->snapshotarr), PointerGetDatum(snapshot));
1156 }
#define PointerGetDatum(X)
Definition: postgres.h:541
ResourceArray snapshotarr
Definition: resowner.c:125
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:259

◆ ResourceOwnerRememberTupleDesc()

void ResourceOwnerRememberTupleDesc ( ResourceOwner  owner,
TupleDesc  tupdesc 
)

Definition at line 1107 of file resowner.c.

References PointerGetDatum, ResourceArrayAdd(), and ResourceOwnerData::tupdescarr.

Referenced by IncrTupleDescRefCount().

1108 {
1109  ResourceArrayAdd(&(owner->tupdescarr), PointerGetDatum(tupdesc));
1110 }
#define PointerGetDatum(X)
Definition: postgres.h:541
ResourceArray tupdescarr
Definition: resowner.c:124
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:259