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 893 of file resowner.c.

References Assert, ResourceOwnerData::bufferarr, and ResourceArrayEnlarge().

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

894 {
895  /* We used to allow pinning buffers without a resowner, but no more */
896  Assert(owner != NULL);
897  ResourceArrayEnlarge(&(owner->bufferarr));
898 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:208
ResourceArray bufferarr
Definition: resowner.c:121
#define Assert(condition)
Definition: c.h:739

◆ ResourceOwnerEnlargeCatCacheListRefs()

void ResourceOwnerEnlargeCatCacheListRefs ( ResourceOwner  owner)

Definition at line 1017 of file resowner.c.

References ResourceOwnerData::catlistrefarr, and ResourceArrayEnlarge().

Referenced by SearchCatCacheList().

1018 {
1020 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:208
ResourceArray catlistrefarr
Definition: resowner.c:123

◆ ResourceOwnerEnlargeCatCacheRefs()

void ResourceOwnerEnlargeCatCacheRefs ( ResourceOwner  owner)

Definition at line 982 of file resowner.c.

References ResourceOwnerData::catrefarr, and ResourceArrayEnlarge().

Referenced by SearchCatCacheInternal(), and SearchCatCacheMiss().

983 {
984  ResourceArrayEnlarge(&(owner->catrefarr));
985 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:208
ResourceArray catrefarr
Definition: resowner.c:122

◆ ResourceOwnerEnlargeDSMs()

void ResourceOwnerEnlargeDSMs ( ResourceOwner  owner)

Definition at line 1278 of file resowner.c.

References ResourceOwnerData::dsmarr, and ResourceArrayEnlarge().

Referenced by dsm_create_descriptor(), and dsm_unpin_mapping().

1279 {
1280  ResourceArrayEnlarge(&(owner->dsmarr));
1281 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:208
ResourceArray dsmarr
Definition: resowner.c:129

◆ ResourceOwnerEnlargeFiles()

void ResourceOwnerEnlargeFiles ( ResourceOwner  owner)

Definition at line 1233 of file resowner.c.

References ResourceOwnerData::filearr, and ResourceArrayEnlarge().

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

1234 {
1235  ResourceArrayEnlarge(&(owner->filearr));
1236 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:208
ResourceArray filearr
Definition: resowner.c:128

◆ ResourceOwnerEnlargeJIT()

void ResourceOwnerEnlargeJIT ( ResourceOwner  owner)

Definition at line 1323 of file resowner.c.

References ResourceOwnerData::jitarr, and ResourceArrayEnlarge().

Referenced by llvm_create_context().

1324 {
1325  ResourceArrayEnlarge(&(owner->jitarr));
1326 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:208
ResourceArray jitarr
Definition: resowner.c:130

◆ ResourceOwnerEnlargePlanCacheRefs()

void ResourceOwnerEnlargePlanCacheRefs ( ResourceOwner  owner)

Definition at line 1097 of file resowner.c.

References ResourceOwnerData::planrefarr, and ResourceArrayEnlarge().

Referenced by GetCachedPlan().

1098 {
1099  ResourceArrayEnlarge(&(owner->planrefarr));
1100 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:208
ResourceArray planrefarr
Definition: resowner.c:125

◆ ResourceOwnerEnlargeRelationRefs()

void ResourceOwnerEnlargeRelationRefs ( ResourceOwner  owner)

Definition at line 1052 of file resowner.c.

References ResourceOwnerData::relrefarr, and ResourceArrayEnlarge().

Referenced by RelationIncrementReferenceCount().

1053 {
1054  ResourceArrayEnlarge(&(owner->relrefarr));
1055 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:208
ResourceArray relrefarr
Definition: resowner.c:124

◆ ResourceOwnerEnlargeSnapshots()

void ResourceOwnerEnlargeSnapshots ( ResourceOwner  owner)

Definition at line 1187 of file resowner.c.

References ResourceArrayEnlarge(), and ResourceOwnerData::snapshotarr.

Referenced by RegisterSnapshotOnOwner().

1188 {
1189  ResourceArrayEnlarge(&(owner->snapshotarr));
1190 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:208
ResourceArray snapshotarr
Definition: resowner.c:127

◆ ResourceOwnerEnlargeTupleDescs()

void ResourceOwnerEnlargeTupleDescs ( ResourceOwner  owner)

Definition at line 1141 of file resowner.c.

References ResourceArrayEnlarge(), and ResourceOwnerData::tupdescarr.

Referenced by IncrTupleDescRefCount().

1142 {
1143  ResourceArrayEnlarge(&(owner->tupdescarr));
1144 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:208
ResourceArray tupdescarr
Definition: resowner.c:126

◆ ResourceOwnerForgetBuffer()

void ResourceOwnerForgetBuffer ( ResourceOwner  owner,
Buffer  buffer 
)

Definition at line 915 of file resowner.c.

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

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

916 {
917  if (!ResourceArrayRemove(&(owner->bufferarr), BufferGetDatum(buffer)))
918  elog(ERROR, "buffer %d is not owned by resource owner %s",
919  buffer, owner->name);
920 }
ResourceArray bufferarr
Definition: resowner.c:121
const char * name
Definition: resowner.c:118
#define ERROR
Definition: elog.h:43
#define BufferGetDatum(buffer)
Definition: resowner.c:44
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:301
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerForgetCatCacheListRef()

void ResourceOwnerForgetCatCacheListRef ( ResourceOwner  owner,
CatCList list 
)

Definition at line 1037 of file resowner.c.

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

Referenced by ReleaseCatCacheList().

1038 {
1039  if (!ResourceArrayRemove(&(owner->catlistrefarr), PointerGetDatum(list)))
1040  elog(ERROR, "catcache list reference %p is not owned by resource owner %s",
1041  list, owner->name);
1042 }
#define PointerGetDatum(X)
Definition: postgres.h:556
const char * name
Definition: resowner.c:118
#define ERROR
Definition: elog.h:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:301
#define elog(elevel,...)
Definition: elog.h:228
ResourceArray catlistrefarr
Definition: resowner.c:123

◆ ResourceOwnerForgetCatCacheRef()

void ResourceOwnerForgetCatCacheRef ( ResourceOwner  owner,
HeapTuple  tuple 
)

Definition at line 1002 of file resowner.c.

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

Referenced by ReleaseCatCache().

1003 {
1004  if (!ResourceArrayRemove(&(owner->catrefarr), PointerGetDatum(tuple)))
1005  elog(ERROR, "catcache reference %p is not owned by resource owner %s",
1006  tuple, owner->name);
1007 }
ResourceArray catrefarr
Definition: resowner.c:122
#define PointerGetDatum(X)
Definition: postgres.h:556
const char * name
Definition: resowner.c:118
#define ERROR
Definition: elog.h:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:301
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerForgetDSM()

void ResourceOwnerForgetDSM ( ResourceOwner  owner,
dsm_segment  
)

Definition at line 1298 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().

1299 {
1300  if (!ResourceArrayRemove(&(owner->dsmarr), PointerGetDatum(seg)))
1301  elog(ERROR, "dynamic shared memory segment %u is not owned by resource owner %s",
1302  dsm_segment_handle(seg), owner->name);
1303 }
#define PointerGetDatum(X)
Definition: postgres.h:556
dsm_handle dsm_segment_handle(dsm_segment *seg)
Definition: dsm.c:966
const char * name
Definition: resowner.c:118
#define ERROR
Definition: elog.h:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:301
#define elog(elevel,...)
Definition: elog.h:228
ResourceArray dsmarr
Definition: resowner.c:129

◆ ResourceOwnerForgetFile()

void ResourceOwnerForgetFile ( ResourceOwner  owner,
File  file 
)

Definition at line 1253 of file resowner.c.

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

Referenced by FileClose().

1254 {
1255  if (!ResourceArrayRemove(&(owner->filearr), FileGetDatum(file)))
1256  elog(ERROR, "temporary file %d is not owned by resource owner %s",
1257  file, owner->name);
1258 }
const char * name
Definition: resowner.c:118
#define ERROR
Definition: elog.h:43
#define FileGetDatum(file)
Definition: resowner.c:42
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:301
#define elog(elevel,...)
Definition: elog.h:228
ResourceArray filearr
Definition: resowner.c:128

◆ ResourceOwnerForgetJIT()

void ResourceOwnerForgetJIT ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1343 of file resowner.c.

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

Referenced by jit_release_context().

1344 {
1345  if (!ResourceArrayRemove(&(owner->jitarr), handle))
1346  elog(ERROR, "JIT context %p is not owned by resource owner %s",
1347  DatumGetPointer(handle), owner->name);
1348 }
const char * name
Definition: resowner.c:118
#define ERROR
Definition: elog.h:43
ResourceArray jitarr
Definition: resowner.c:130
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:301
#define DatumGetPointer(X)
Definition: postgres.h:549
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerForgetLock()

void ResourceOwnerForgetLock ( ResourceOwner  owner,
LOCALLOCK locallock 
)

Definition at line 953 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().

954 {
955  int i;
956 
957  if (owner->nlocks > MAX_RESOWNER_LOCKS)
958  return; /* we have overflowed */
959 
960  Assert(owner->nlocks > 0);
961  for (i = owner->nlocks - 1; i >= 0; i--)
962  {
963  if (locallock == owner->locks[i])
964  {
965  owner->locks[i] = owner->locks[owner->nlocks - 1];
966  owner->nlocks--;
967  return;
968  }
969  }
970  elog(ERROR, "lock reference %p is not owned by resource owner %s",
971  locallock, owner->name);
972 }
#define MAX_RESOWNER_LOCKS
Definition: resowner.c:108
const char * name
Definition: resowner.c:118
#define ERROR
Definition: elog.h:43
#define Assert(condition)
Definition: c.h:739
LOCALLOCK * locks[MAX_RESOWNER_LOCKS]
Definition: resowner.c:134
#define elog(elevel,...)
Definition: elog.h:228
int i

◆ ResourceOwnerForgetPlanCacheRef()

void ResourceOwnerForgetPlanCacheRef ( ResourceOwner  owner,
CachedPlan plan 
)

Definition at line 1117 of file resowner.c.

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

Referenced by ReleaseCachedPlan().

1118 {
1119  if (!ResourceArrayRemove(&(owner->planrefarr), PointerGetDatum(plan)))
1120  elog(ERROR, "plancache reference %p is not owned by resource owner %s",
1121  plan, owner->name);
1122 }
#define PointerGetDatum(X)
Definition: postgres.h:556
const char * name
Definition: resowner.c:118
#define ERROR
Definition: elog.h:43
ResourceArray planrefarr
Definition: resowner.c:125
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:301
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerForgetRelationRef()

void ResourceOwnerForgetRelationRef ( ResourceOwner  owner,
Relation  rel 
)

Definition at line 1072 of file resowner.c.

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

Referenced by RelationDecrementReferenceCount().

1073 {
1074  if (!ResourceArrayRemove(&(owner->relrefarr), PointerGetDatum(rel)))
1075  elog(ERROR, "relcache reference %s is not owned by resource owner %s",
1076  RelationGetRelationName(rel), owner->name);
1077 }
ResourceArray relrefarr
Definition: resowner.c:124
#define PointerGetDatum(X)
Definition: postgres.h:556
const char * name
Definition: resowner.c:118
#define ERROR
Definition: elog.h:43
#define RelationGetRelationName(relation)
Definition: rel.h:456
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:301
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerForgetSnapshot()

void ResourceOwnerForgetSnapshot ( ResourceOwner  owner,
Snapshot  snapshot 
)

Definition at line 1207 of file resowner.c.

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

Referenced by UnregisterSnapshotFromOwner().

1208 {
1209  if (!ResourceArrayRemove(&(owner->snapshotarr), PointerGetDatum(snapshot)))
1210  elog(ERROR, "snapshot reference %p is not owned by resource owner %s",
1211  snapshot, owner->name);
1212 }
#define PointerGetDatum(X)
Definition: postgres.h:556
ResourceArray snapshotarr
Definition: resowner.c:127
const char * name
Definition: resowner.c:118
#define ERROR
Definition: elog.h:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:301
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerForgetTupleDesc()

void ResourceOwnerForgetTupleDesc ( ResourceOwner  owner,
TupleDesc  tupdesc 
)

Definition at line 1161 of file resowner.c.

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

Referenced by DecrTupleDescRefCount().

1162 {
1163  if (!ResourceArrayRemove(&(owner->tupdescarr), PointerGetDatum(tupdesc)))
1164  elog(ERROR, "tupdesc reference %p is not owned by resource owner %s",
1165  tupdesc, owner->name);
1166 }
#define PointerGetDatum(X)
Definition: postgres.h:556
const char * name
Definition: resowner.c:118
#define ERROR
Definition: elog.h:43
ResourceArray tupdescarr
Definition: resowner.c:126
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:301
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerRememberBuffer()

void ResourceOwnerRememberBuffer ( ResourceOwner  owner,
Buffer  buffer 
)

Definition at line 906 of file resowner.c.

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

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

907 {
908  ResourceArrayAdd(&(owner->bufferarr), BufferGetDatum(buffer));
909 }
ResourceArray bufferarr
Definition: resowner.c:121
#define BufferGetDatum(buffer)
Definition: resowner.c:44
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:263

◆ ResourceOwnerRememberCatCacheListRef()

void ResourceOwnerRememberCatCacheListRef ( ResourceOwner  owner,
CatCList list 
)

Definition at line 1028 of file resowner.c.

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

Referenced by SearchCatCacheList().

1029 {
1031 }
#define PointerGetDatum(X)
Definition: postgres.h:556
ResourceArray catlistrefarr
Definition: resowner.c:123
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:263

◆ ResourceOwnerRememberCatCacheRef()

void ResourceOwnerRememberCatCacheRef ( ResourceOwner  owner,
HeapTuple  tuple 
)

Definition at line 993 of file resowner.c.

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

Referenced by SearchCatCacheInternal(), and SearchCatCacheMiss().

994 {
995  ResourceArrayAdd(&(owner->catrefarr), PointerGetDatum(tuple));
996 }
ResourceArray catrefarr
Definition: resowner.c:122
#define PointerGetDatum(X)
Definition: postgres.h:556
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:263

◆ ResourceOwnerRememberDSM()

void ResourceOwnerRememberDSM ( ResourceOwner  owner,
dsm_segment  
)

Definition at line 1289 of file resowner.c.

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

Referenced by dsm_create_descriptor(), and dsm_unpin_mapping().

1290 {
1291  ResourceArrayAdd(&(owner->dsmarr), PointerGetDatum(seg));
1292 }
#define PointerGetDatum(X)
Definition: postgres.h:556
ResourceArray dsmarr
Definition: resowner.c:129
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:263

◆ ResourceOwnerRememberFile()

void ResourceOwnerRememberFile ( ResourceOwner  owner,
File  file 
)

Definition at line 1244 of file resowner.c.

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

Referenced by RegisterTemporaryFile().

1245 {
1246  ResourceArrayAdd(&(owner->filearr), FileGetDatum(file));
1247 }
#define FileGetDatum(file)
Definition: resowner.c:42
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:263
ResourceArray filearr
Definition: resowner.c:128

◆ ResourceOwnerRememberJIT()

void ResourceOwnerRememberJIT ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1334 of file resowner.c.

References ResourceOwnerData::jitarr, and ResourceArrayAdd().

Referenced by llvm_create_context().

1335 {
1336  ResourceArrayAdd(&(owner->jitarr), handle);
1337 }
ResourceArray jitarr
Definition: resowner.c:130
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:263

◆ ResourceOwnerRememberLock()

void ResourceOwnerRememberLock ( ResourceOwner  owner,
LOCALLOCK locallock 
)

Definition at line 933 of file resowner.c.

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

Referenced by GrantLockLocal(), and LockReassignOwner().

934 {
935  Assert(locallock != NULL);
936 
937  if (owner->nlocks > MAX_RESOWNER_LOCKS)
938  return; /* we have already overflowed */
939 
940  if (owner->nlocks < MAX_RESOWNER_LOCKS)
941  owner->locks[owner->nlocks] = locallock;
942  else
943  {
944  /* overflowed */
945  }
946  owner->nlocks++;
947 }
#define MAX_RESOWNER_LOCKS
Definition: resowner.c:108
#define Assert(condition)
Definition: c.h:739
LOCALLOCK * locks[MAX_RESOWNER_LOCKS]
Definition: resowner.c:134

◆ ResourceOwnerRememberPlanCacheRef()

void ResourceOwnerRememberPlanCacheRef ( ResourceOwner  owner,
CachedPlan plan 
)

Definition at line 1108 of file resowner.c.

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

Referenced by GetCachedPlan().

1109 {
1110  ResourceArrayAdd(&(owner->planrefarr), PointerGetDatum(plan));
1111 }
#define PointerGetDatum(X)
Definition: postgres.h:556
ResourceArray planrefarr
Definition: resowner.c:125
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:263

◆ ResourceOwnerRememberRelationRef()

void ResourceOwnerRememberRelationRef ( ResourceOwner  owner,
Relation  rel 
)

Definition at line 1063 of file resowner.c.

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

Referenced by RelationIncrementReferenceCount().

1064 {
1065  ResourceArrayAdd(&(owner->relrefarr), PointerGetDatum(rel));
1066 }
ResourceArray relrefarr
Definition: resowner.c:124
#define PointerGetDatum(X)
Definition: postgres.h:556
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:263

◆ ResourceOwnerRememberSnapshot()

void ResourceOwnerRememberSnapshot ( ResourceOwner  owner,
Snapshot  snapshot 
)

Definition at line 1198 of file resowner.c.

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

Referenced by RegisterSnapshotOnOwner().

1199 {
1200  ResourceArrayAdd(&(owner->snapshotarr), PointerGetDatum(snapshot));
1201 }
#define PointerGetDatum(X)
Definition: postgres.h:556
ResourceArray snapshotarr
Definition: resowner.c:127
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:263

◆ ResourceOwnerRememberTupleDesc()

void ResourceOwnerRememberTupleDesc ( ResourceOwner  owner,
TupleDesc  tupdesc 
)

Definition at line 1152 of file resowner.c.

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

Referenced by IncrTupleDescRefCount().

1153 {
1154  ResourceArrayAdd(&(owner->tupdescarr), PointerGetDatum(tupdesc));
1155 }
#define PointerGetDatum(X)
Definition: postgres.h:556
ResourceArray tupdescarr
Definition: resowner.c:126
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:263