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)
 
void ResourceOwnerEnlargeCryptoHash (ResourceOwner owner)
 
void ResourceOwnerRememberCryptoHash (ResourceOwner owner, Datum handle)
 
void ResourceOwnerForgetCryptoHash (ResourceOwner owner, Datum handle)
 
void ResourceOwnerEnlargeHMAC (ResourceOwner owner)
 
void ResourceOwnerRememberHMAC (ResourceOwner owner, Datum handle)
 
void ResourceOwnerForgetHMAC (ResourceOwner owner, Datum handle)
 

Function Documentation

◆ ResourceOwnerEnlargeBuffers()

void ResourceOwnerEnlargeBuffers ( ResourceOwner  owner)

Definition at line 946 of file resowner.c.

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

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

947 {
948  /* We used to allow pinning buffers without a resowner, but no more */
949  Assert(owner != NULL);
950  ResourceArrayEnlarge(&(owner->bufferarr));
951 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:214
ResourceArray bufferarr
Definition: resowner.c:123
#define Assert(condition)
Definition: c.h:804

◆ ResourceOwnerEnlargeCatCacheListRefs()

void ResourceOwnerEnlargeCatCacheListRefs ( ResourceOwner  owner)

Definition at line 1070 of file resowner.c.

References ResourceOwnerData::catlistrefarr, and ResourceArrayEnlarge().

Referenced by SearchCatCacheList().

1071 {
1073 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:214
ResourceArray catlistrefarr
Definition: resowner.c:125

◆ ResourceOwnerEnlargeCatCacheRefs()

void ResourceOwnerEnlargeCatCacheRefs ( ResourceOwner  owner)

Definition at line 1035 of file resowner.c.

References ResourceOwnerData::catrefarr, and ResourceArrayEnlarge().

Referenced by SearchCatCacheInternal(), and SearchCatCacheMiss().

1036 {
1037  ResourceArrayEnlarge(&(owner->catrefarr));
1038 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:214
ResourceArray catrefarr
Definition: resowner.c:124

◆ ResourceOwnerEnlargeCryptoHash()

void ResourceOwnerEnlargeCryptoHash ( ResourceOwner  owner)

Definition at line 1411 of file resowner.c.

References ResourceOwnerData::cryptohasharr, and ResourceArrayEnlarge().

Referenced by pg_cryptohash_create().

1412 {
1414 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:214
ResourceArray cryptohasharr
Definition: resowner.c:133

◆ ResourceOwnerEnlargeDSMs()

void ResourceOwnerEnlargeDSMs ( ResourceOwner  owner)

Definition at line 1331 of file resowner.c.

References ResourceOwnerData::dsmarr, and ResourceArrayEnlarge().

Referenced by dsm_create_descriptor(), and dsm_unpin_mapping().

1332 {
1333  ResourceArrayEnlarge(&(owner->dsmarr));
1334 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:214
ResourceArray dsmarr
Definition: resowner.c:131

◆ ResourceOwnerEnlargeFiles()

void ResourceOwnerEnlargeFiles ( ResourceOwner  owner)

Definition at line 1286 of file resowner.c.

References ResourceOwnerData::filearr, and ResourceArrayEnlarge().

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

1287 {
1288  ResourceArrayEnlarge(&(owner->filearr));
1289 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:214
ResourceArray filearr
Definition: resowner.c:130

◆ ResourceOwnerEnlargeHMAC()

void ResourceOwnerEnlargeHMAC ( ResourceOwner  owner)

Definition at line 1456 of file resowner.c.

References ResourceOwnerData::hmacarr, and ResourceArrayEnlarge().

Referenced by pg_hmac_create().

1457 {
1458  ResourceArrayEnlarge(&(owner->hmacarr));
1459 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:214
ResourceArray hmacarr
Definition: resowner.c:134

◆ ResourceOwnerEnlargeJIT()

void ResourceOwnerEnlargeJIT ( ResourceOwner  owner)

Definition at line 1376 of file resowner.c.

References ResourceOwnerData::jitarr, and ResourceArrayEnlarge().

Referenced by llvm_create_context().

1377 {
1378  ResourceArrayEnlarge(&(owner->jitarr));
1379 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:214
ResourceArray jitarr
Definition: resowner.c:132

◆ ResourceOwnerEnlargePlanCacheRefs()

void ResourceOwnerEnlargePlanCacheRefs ( ResourceOwner  owner)

Definition at line 1150 of file resowner.c.

References ResourceOwnerData::planrefarr, and ResourceArrayEnlarge().

Referenced by CachedPlanAllowsSimpleValidityCheck(), CachedPlanIsSimplyValid(), and GetCachedPlan().

1151 {
1152  ResourceArrayEnlarge(&(owner->planrefarr));
1153 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:214
ResourceArray planrefarr
Definition: resowner.c:127

◆ ResourceOwnerEnlargeRelationRefs()

void ResourceOwnerEnlargeRelationRefs ( ResourceOwner  owner)

Definition at line 1105 of file resowner.c.

References ResourceOwnerData::relrefarr, and ResourceArrayEnlarge().

Referenced by RelationIncrementReferenceCount().

1106 {
1107  ResourceArrayEnlarge(&(owner->relrefarr));
1108 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:214
ResourceArray relrefarr
Definition: resowner.c:126

◆ ResourceOwnerEnlargeSnapshots()

void ResourceOwnerEnlargeSnapshots ( ResourceOwner  owner)

Definition at line 1240 of file resowner.c.

References ResourceArrayEnlarge(), and ResourceOwnerData::snapshotarr.

Referenced by RegisterSnapshotOnOwner().

1241 {
1242  ResourceArrayEnlarge(&(owner->snapshotarr));
1243 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:214
ResourceArray snapshotarr
Definition: resowner.c:129

◆ ResourceOwnerEnlargeTupleDescs()

void ResourceOwnerEnlargeTupleDescs ( ResourceOwner  owner)

Definition at line 1194 of file resowner.c.

References ResourceArrayEnlarge(), and ResourceOwnerData::tupdescarr.

Referenced by IncrTupleDescRefCount().

1195 {
1196  ResourceArrayEnlarge(&(owner->tupdescarr));
1197 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:214
ResourceArray tupdescarr
Definition: resowner.c:128

◆ ResourceOwnerForgetBuffer()

void ResourceOwnerForgetBuffer ( ResourceOwner  owner,
Buffer  buffer 
)

Definition at line 968 of file resowner.c.

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

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

969 {
970  if (!ResourceArrayRemove(&(owner->bufferarr), BufferGetDatum(buffer)))
971  elog(ERROR, "buffer %d is not owned by resource owner %s",
972  buffer, owner->name);
973 }
ResourceArray bufferarr
Definition: resowner.c:123
const char * name
Definition: resowner.c:120
#define ERROR
Definition: elog.h:46
#define BufferGetDatum(buffer)
Definition: resowner.c:46
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:307
#define elog(elevel,...)
Definition: elog.h:232

◆ ResourceOwnerForgetCatCacheListRef()

void ResourceOwnerForgetCatCacheListRef ( ResourceOwner  owner,
CatCList list 
)

Definition at line 1090 of file resowner.c.

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

Referenced by ReleaseCatCacheList().

1091 {
1092  if (!ResourceArrayRemove(&(owner->catlistrefarr), PointerGetDatum(list)))
1093  elog(ERROR, "catcache list reference %p is not owned by resource owner %s",
1094  list, owner->name);
1095 }
#define PointerGetDatum(X)
Definition: postgres.h:600
const char * name
Definition: resowner.c:120
#define ERROR
Definition: elog.h:46
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:307
#define elog(elevel,...)
Definition: elog.h:232
ResourceArray catlistrefarr
Definition: resowner.c:125

◆ ResourceOwnerForgetCatCacheRef()

void ResourceOwnerForgetCatCacheRef ( ResourceOwner  owner,
HeapTuple  tuple 
)

Definition at line 1055 of file resowner.c.

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

Referenced by ReleaseCatCache().

1056 {
1057  if (!ResourceArrayRemove(&(owner->catrefarr), PointerGetDatum(tuple)))
1058  elog(ERROR, "catcache reference %p is not owned by resource owner %s",
1059  tuple, owner->name);
1060 }
ResourceArray catrefarr
Definition: resowner.c:124
#define PointerGetDatum(X)
Definition: postgres.h:600
const char * name
Definition: resowner.c:120
#define ERROR
Definition: elog.h:46
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:307
#define elog(elevel,...)
Definition: elog.h:232

◆ ResourceOwnerForgetCryptoHash()

void ResourceOwnerForgetCryptoHash ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1431 of file resowner.c.

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

Referenced by pg_cryptohash_free().

1432 {
1433  if (!ResourceArrayRemove(&(owner->cryptohasharr), handle))
1434  elog(ERROR, "cryptohash context %p is not owned by resource owner %s",
1435  DatumGetPointer(handle), owner->name);
1436 }
const char * name
Definition: resowner.c:120
#define ERROR
Definition: elog.h:46
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:307
#define DatumGetPointer(X)
Definition: postgres.h:593
#define elog(elevel,...)
Definition: elog.h:232
ResourceArray cryptohasharr
Definition: resowner.c:133

◆ ResourceOwnerForgetDSM()

void ResourceOwnerForgetDSM ( ResourceOwner  owner,
dsm_segment  
)

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

1352 {
1353  if (!ResourceArrayRemove(&(owner->dsmarr), PointerGetDatum(seg)))
1354  elog(ERROR, "dynamic shared memory segment %u is not owned by resource owner %s",
1355  dsm_segment_handle(seg), owner->name);
1356 }
#define PointerGetDatum(X)
Definition: postgres.h:600
dsm_handle dsm_segment_handle(dsm_segment *seg)
Definition: dsm.c:1087
const char * name
Definition: resowner.c:120
#define ERROR
Definition: elog.h:46
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:307
#define elog(elevel,...)
Definition: elog.h:232
ResourceArray dsmarr
Definition: resowner.c:131

◆ ResourceOwnerForgetFile()

void ResourceOwnerForgetFile ( ResourceOwner  owner,
File  file 
)

Definition at line 1306 of file resowner.c.

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

Referenced by FileClose().

1307 {
1308  if (!ResourceArrayRemove(&(owner->filearr), FileGetDatum(file)))
1309  elog(ERROR, "temporary file %d is not owned by resource owner %s",
1310  file, owner->name);
1311 }
const char * name
Definition: resowner.c:120
#define ERROR
Definition: elog.h:46
#define FileGetDatum(file)
Definition: resowner.c:44
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:307
#define elog(elevel,...)
Definition: elog.h:232
ResourceArray filearr
Definition: resowner.c:130

◆ ResourceOwnerForgetHMAC()

void ResourceOwnerForgetHMAC ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1476 of file resowner.c.

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

Referenced by pg_hmac_free().

1477 {
1478  if (!ResourceArrayRemove(&(owner->hmacarr), handle))
1479  elog(ERROR, "HMAC context %p is not owned by resource owner %s",
1480  DatumGetPointer(handle), owner->name);
1481 }
const char * name
Definition: resowner.c:120
#define ERROR
Definition: elog.h:46
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:307
#define DatumGetPointer(X)
Definition: postgres.h:593
#define elog(elevel,...)
Definition: elog.h:232
ResourceArray hmacarr
Definition: resowner.c:134

◆ ResourceOwnerForgetJIT()

void ResourceOwnerForgetJIT ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1396 of file resowner.c.

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

Referenced by jit_release_context().

1397 {
1398  if (!ResourceArrayRemove(&(owner->jitarr), handle))
1399  elog(ERROR, "JIT context %p is not owned by resource owner %s",
1400  DatumGetPointer(handle), owner->name);
1401 }
const char * name
Definition: resowner.c:120
#define ERROR
Definition: elog.h:46
ResourceArray jitarr
Definition: resowner.c:132
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:307
#define DatumGetPointer(X)
Definition: postgres.h:593
#define elog(elevel,...)
Definition: elog.h:232

◆ ResourceOwnerForgetLock()

void ResourceOwnerForgetLock ( ResourceOwner  owner,
LOCALLOCK locallock 
)

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

1007 {
1008  int i;
1009 
1010  if (owner->nlocks > MAX_RESOWNER_LOCKS)
1011  return; /* we have overflowed */
1012 
1013  Assert(owner->nlocks > 0);
1014  for (i = owner->nlocks - 1; i >= 0; i--)
1015  {
1016  if (locallock == owner->locks[i])
1017  {
1018  owner->locks[i] = owner->locks[owner->nlocks - 1];
1019  owner->nlocks--;
1020  return;
1021  }
1022  }
1023  elog(ERROR, "lock reference %p is not owned by resource owner %s",
1024  locallock, owner->name);
1025 }
#define MAX_RESOWNER_LOCKS
Definition: resowner.c:110
const char * name
Definition: resowner.c:120
#define ERROR
Definition: elog.h:46
#define Assert(condition)
Definition: c.h:804
LOCALLOCK * locks[MAX_RESOWNER_LOCKS]
Definition: resowner.c:138
#define elog(elevel,...)
Definition: elog.h:232
int i

◆ ResourceOwnerForgetPlanCacheRef()

void ResourceOwnerForgetPlanCacheRef ( ResourceOwner  owner,
CachedPlan plan 
)

Definition at line 1170 of file resowner.c.

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

Referenced by ReleaseCachedPlan().

1171 {
1172  if (!ResourceArrayRemove(&(owner->planrefarr), PointerGetDatum(plan)))
1173  elog(ERROR, "plancache reference %p is not owned by resource owner %s",
1174  plan, owner->name);
1175 }
#define PointerGetDatum(X)
Definition: postgres.h:600
const char * name
Definition: resowner.c:120
#define ERROR
Definition: elog.h:46
ResourceArray planrefarr
Definition: resowner.c:127
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:307
#define elog(elevel,...)
Definition: elog.h:232

◆ ResourceOwnerForgetRelationRef()

void ResourceOwnerForgetRelationRef ( ResourceOwner  owner,
Relation  rel 
)

Definition at line 1125 of file resowner.c.

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

Referenced by RelationDecrementReferenceCount().

1126 {
1127  if (!ResourceArrayRemove(&(owner->relrefarr), PointerGetDatum(rel)))
1128  elog(ERROR, "relcache reference %s is not owned by resource owner %s",
1129  RelationGetRelationName(rel), owner->name);
1130 }
ResourceArray relrefarr
Definition: resowner.c:126
#define PointerGetDatum(X)
Definition: postgres.h:600
const char * name
Definition: resowner.c:120
#define ERROR
Definition: elog.h:46
#define RelationGetRelationName(relation)
Definition: rel.h:511
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:307
#define elog(elevel,...)
Definition: elog.h:232

◆ ResourceOwnerForgetSnapshot()

void ResourceOwnerForgetSnapshot ( ResourceOwner  owner,
Snapshot  snapshot 
)

Definition at line 1260 of file resowner.c.

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

Referenced by UnregisterSnapshotFromOwner().

1261 {
1262  if (!ResourceArrayRemove(&(owner->snapshotarr), PointerGetDatum(snapshot)))
1263  elog(ERROR, "snapshot reference %p is not owned by resource owner %s",
1264  snapshot, owner->name);
1265 }
#define PointerGetDatum(X)
Definition: postgres.h:600
ResourceArray snapshotarr
Definition: resowner.c:129
const char * name
Definition: resowner.c:120
#define ERROR
Definition: elog.h:46
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:307
#define elog(elevel,...)
Definition: elog.h:232

◆ ResourceOwnerForgetTupleDesc()

void ResourceOwnerForgetTupleDesc ( ResourceOwner  owner,
TupleDesc  tupdesc 
)

Definition at line 1214 of file resowner.c.

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

Referenced by DecrTupleDescRefCount().

1215 {
1216  if (!ResourceArrayRemove(&(owner->tupdescarr), PointerGetDatum(tupdesc)))
1217  elog(ERROR, "tupdesc reference %p is not owned by resource owner %s",
1218  tupdesc, owner->name);
1219 }
#define PointerGetDatum(X)
Definition: postgres.h:600
const char * name
Definition: resowner.c:120
#define ERROR
Definition: elog.h:46
ResourceArray tupdescarr
Definition: resowner.c:128
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:307
#define elog(elevel,...)
Definition: elog.h:232

◆ ResourceOwnerRememberBuffer()

void ResourceOwnerRememberBuffer ( ResourceOwner  owner,
Buffer  buffer 
)

Definition at line 959 of file resowner.c.

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

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

960 {
961  ResourceArrayAdd(&(owner->bufferarr), BufferGetDatum(buffer));
962 }
ResourceArray bufferarr
Definition: resowner.c:123
#define BufferGetDatum(buffer)
Definition: resowner.c:46
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:269

◆ ResourceOwnerRememberCatCacheListRef()

void ResourceOwnerRememberCatCacheListRef ( ResourceOwner  owner,
CatCList list 
)

Definition at line 1081 of file resowner.c.

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

Referenced by SearchCatCacheList().

1082 {
1084 }
#define PointerGetDatum(X)
Definition: postgres.h:600
ResourceArray catlistrefarr
Definition: resowner.c:125
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:269

◆ ResourceOwnerRememberCatCacheRef()

void ResourceOwnerRememberCatCacheRef ( ResourceOwner  owner,
HeapTuple  tuple 
)

Definition at line 1046 of file resowner.c.

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

Referenced by SearchCatCacheInternal(), and SearchCatCacheMiss().

1047 {
1048  ResourceArrayAdd(&(owner->catrefarr), PointerGetDatum(tuple));
1049 }
ResourceArray catrefarr
Definition: resowner.c:124
#define PointerGetDatum(X)
Definition: postgres.h:600
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:269

◆ ResourceOwnerRememberCryptoHash()

void ResourceOwnerRememberCryptoHash ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1422 of file resowner.c.

References ResourceOwnerData::cryptohasharr, and ResourceArrayAdd().

Referenced by pg_cryptohash_create().

1423 {
1424  ResourceArrayAdd(&(owner->cryptohasharr), handle);
1425 }
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:269
ResourceArray cryptohasharr
Definition: resowner.c:133

◆ ResourceOwnerRememberDSM()

void ResourceOwnerRememberDSM ( ResourceOwner  owner,
dsm_segment  
)

Definition at line 1342 of file resowner.c.

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

Referenced by dsm_create_descriptor(), and dsm_unpin_mapping().

1343 {
1344  ResourceArrayAdd(&(owner->dsmarr), PointerGetDatum(seg));
1345 }
#define PointerGetDatum(X)
Definition: postgres.h:600
ResourceArray dsmarr
Definition: resowner.c:131
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:269

◆ ResourceOwnerRememberFile()

void ResourceOwnerRememberFile ( ResourceOwner  owner,
File  file 
)

Definition at line 1297 of file resowner.c.

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

Referenced by RegisterTemporaryFile().

1298 {
1299  ResourceArrayAdd(&(owner->filearr), FileGetDatum(file));
1300 }
#define FileGetDatum(file)
Definition: resowner.c:44
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:269
ResourceArray filearr
Definition: resowner.c:130

◆ ResourceOwnerRememberHMAC()

void ResourceOwnerRememberHMAC ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1467 of file resowner.c.

References ResourceOwnerData::hmacarr, and ResourceArrayAdd().

Referenced by pg_hmac_create().

1468 {
1469  ResourceArrayAdd(&(owner->hmacarr), handle);
1470 }
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:269
ResourceArray hmacarr
Definition: resowner.c:134

◆ ResourceOwnerRememberJIT()

void ResourceOwnerRememberJIT ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1387 of file resowner.c.

References ResourceOwnerData::jitarr, and ResourceArrayAdd().

Referenced by llvm_create_context().

1388 {
1389  ResourceArrayAdd(&(owner->jitarr), handle);
1390 }
ResourceArray jitarr
Definition: resowner.c:132
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:269

◆ ResourceOwnerRememberLock()

void ResourceOwnerRememberLock ( ResourceOwner  owner,
LOCALLOCK locallock 
)

Definition at line 986 of file resowner.c.

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

Referenced by GrantLockLocal(), and LockReassignOwner().

987 {
988  Assert(locallock != NULL);
989 
990  if (owner->nlocks > MAX_RESOWNER_LOCKS)
991  return; /* we have already overflowed */
992 
993  if (owner->nlocks < MAX_RESOWNER_LOCKS)
994  owner->locks[owner->nlocks] = locallock;
995  else
996  {
997  /* overflowed */
998  }
999  owner->nlocks++;
1000 }
#define MAX_RESOWNER_LOCKS
Definition: resowner.c:110
#define Assert(condition)
Definition: c.h:804
LOCALLOCK * locks[MAX_RESOWNER_LOCKS]
Definition: resowner.c:138

◆ ResourceOwnerRememberPlanCacheRef()

void ResourceOwnerRememberPlanCacheRef ( ResourceOwner  owner,
CachedPlan plan 
)

Definition at line 1161 of file resowner.c.

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

Referenced by CachedPlanAllowsSimpleValidityCheck(), CachedPlanIsSimplyValid(), and GetCachedPlan().

1162 {
1163  ResourceArrayAdd(&(owner->planrefarr), PointerGetDatum(plan));
1164 }
#define PointerGetDatum(X)
Definition: postgres.h:600
ResourceArray planrefarr
Definition: resowner.c:127
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:269

◆ ResourceOwnerRememberRelationRef()

void ResourceOwnerRememberRelationRef ( ResourceOwner  owner,
Relation  rel 
)

Definition at line 1116 of file resowner.c.

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

Referenced by RelationIncrementReferenceCount().

1117 {
1118  ResourceArrayAdd(&(owner->relrefarr), PointerGetDatum(rel));
1119 }
ResourceArray relrefarr
Definition: resowner.c:126
#define PointerGetDatum(X)
Definition: postgres.h:600
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:269

◆ ResourceOwnerRememberSnapshot()

void ResourceOwnerRememberSnapshot ( ResourceOwner  owner,
Snapshot  snapshot 
)

Definition at line 1251 of file resowner.c.

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

Referenced by RegisterSnapshotOnOwner().

1252 {
1253  ResourceArrayAdd(&(owner->snapshotarr), PointerGetDatum(snapshot));
1254 }
#define PointerGetDatum(X)
Definition: postgres.h:600
ResourceArray snapshotarr
Definition: resowner.c:129
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:269

◆ ResourceOwnerRememberTupleDesc()

void ResourceOwnerRememberTupleDesc ( ResourceOwner  owner,
TupleDesc  tupdesc 
)

Definition at line 1205 of file resowner.c.

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

Referenced by IncrTupleDescRefCount().

1206 {
1207  ResourceArrayAdd(&(owner->tupdescarr), PointerGetDatum(tupdesc));
1208 }
#define PointerGetDatum(X)
Definition: postgres.h:600
ResourceArray tupdescarr
Definition: resowner.c:128
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:269