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)
 

Function Documentation

◆ ResourceOwnerEnlargeBuffers()

void ResourceOwnerEnlargeBuffers ( ResourceOwner  owner)

Definition at line 934 of file resowner.c.

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

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

935 {
936  /* We used to allow pinning buffers without a resowner, but no more */
937  Assert(owner != NULL);
938  ResourceArrayEnlarge(&(owner->bufferarr));
939 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:211
ResourceArray bufferarr
Definition: resowner.c:122
#define Assert(condition)
Definition: c.h:800

◆ ResourceOwnerEnlargeCatCacheListRefs()

void ResourceOwnerEnlargeCatCacheListRefs ( ResourceOwner  owner)

Definition at line 1058 of file resowner.c.

References ResourceOwnerData::catlistrefarr, and ResourceArrayEnlarge().

Referenced by SearchCatCacheList().

1059 {
1061 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:211
ResourceArray catlistrefarr
Definition: resowner.c:124

◆ ResourceOwnerEnlargeCatCacheRefs()

void ResourceOwnerEnlargeCatCacheRefs ( ResourceOwner  owner)

Definition at line 1023 of file resowner.c.

References ResourceOwnerData::catrefarr, and ResourceArrayEnlarge().

Referenced by SearchCatCacheInternal(), and SearchCatCacheMiss().

1024 {
1025  ResourceArrayEnlarge(&(owner->catrefarr));
1026 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:211
ResourceArray catrefarr
Definition: resowner.c:123

◆ ResourceOwnerEnlargeCryptoHash()

void ResourceOwnerEnlargeCryptoHash ( ResourceOwner  owner)

Definition at line 1399 of file resowner.c.

References ResourceOwnerData::cryptohasharr, and ResourceArrayEnlarge().

Referenced by pg_cryptohash_create().

1400 {
1402 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:211
ResourceArray cryptohasharr
Definition: resowner.c:132

◆ ResourceOwnerEnlargeDSMs()

void ResourceOwnerEnlargeDSMs ( ResourceOwner  owner)

Definition at line 1319 of file resowner.c.

References ResourceOwnerData::dsmarr, and ResourceArrayEnlarge().

Referenced by dsm_create_descriptor(), and dsm_unpin_mapping().

1320 {
1321  ResourceArrayEnlarge(&(owner->dsmarr));
1322 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:211
ResourceArray dsmarr
Definition: resowner.c:130

◆ ResourceOwnerEnlargeFiles()

void ResourceOwnerEnlargeFiles ( ResourceOwner  owner)

Definition at line 1274 of file resowner.c.

References ResourceOwnerData::filearr, and ResourceArrayEnlarge().

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

1275 {
1276  ResourceArrayEnlarge(&(owner->filearr));
1277 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:211
ResourceArray filearr
Definition: resowner.c:129

◆ ResourceOwnerEnlargeJIT()

void ResourceOwnerEnlargeJIT ( ResourceOwner  owner)

Definition at line 1364 of file resowner.c.

References ResourceOwnerData::jitarr, and ResourceArrayEnlarge().

Referenced by llvm_create_context().

1365 {
1366  ResourceArrayEnlarge(&(owner->jitarr));
1367 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:211
ResourceArray jitarr
Definition: resowner.c:131

◆ ResourceOwnerEnlargePlanCacheRefs()

void ResourceOwnerEnlargePlanCacheRefs ( ResourceOwner  owner)

Definition at line 1138 of file resowner.c.

References ResourceOwnerData::planrefarr, and ResourceArrayEnlarge().

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

1139 {
1140  ResourceArrayEnlarge(&(owner->planrefarr));
1141 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:211
ResourceArray planrefarr
Definition: resowner.c:126

◆ ResourceOwnerEnlargeRelationRefs()

void ResourceOwnerEnlargeRelationRefs ( ResourceOwner  owner)

Definition at line 1093 of file resowner.c.

References ResourceOwnerData::relrefarr, and ResourceArrayEnlarge().

Referenced by RelationIncrementReferenceCount().

1094 {
1095  ResourceArrayEnlarge(&(owner->relrefarr));
1096 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:211
ResourceArray relrefarr
Definition: resowner.c:125

◆ ResourceOwnerEnlargeSnapshots()

void ResourceOwnerEnlargeSnapshots ( ResourceOwner  owner)

Definition at line 1228 of file resowner.c.

References ResourceArrayEnlarge(), and ResourceOwnerData::snapshotarr.

Referenced by RegisterSnapshotOnOwner().

1229 {
1230  ResourceArrayEnlarge(&(owner->snapshotarr));
1231 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:211
ResourceArray snapshotarr
Definition: resowner.c:128

◆ ResourceOwnerEnlargeTupleDescs()

void ResourceOwnerEnlargeTupleDescs ( ResourceOwner  owner)

Definition at line 1182 of file resowner.c.

References ResourceArrayEnlarge(), and ResourceOwnerData::tupdescarr.

Referenced by IncrTupleDescRefCount().

1183 {
1184  ResourceArrayEnlarge(&(owner->tupdescarr));
1185 }
static void ResourceArrayEnlarge(ResourceArray *resarr)
Definition: resowner.c:211
ResourceArray tupdescarr
Definition: resowner.c:127

◆ ResourceOwnerForgetBuffer()

void ResourceOwnerForgetBuffer ( ResourceOwner  owner,
Buffer  buffer 
)

Definition at line 956 of file resowner.c.

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

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

957 {
958  if (!ResourceArrayRemove(&(owner->bufferarr), BufferGetDatum(buffer)))
959  elog(ERROR, "buffer %d is not owned by resource owner %s",
960  buffer, owner->name);
961 }
ResourceArray bufferarr
Definition: resowner.c:122
const char * name
Definition: resowner.c:119
#define ERROR
Definition: elog.h:43
#define BufferGetDatum(buffer)
Definition: resowner.c:45
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:304
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerForgetCatCacheListRef()

void ResourceOwnerForgetCatCacheListRef ( ResourceOwner  owner,
CatCList list 
)

Definition at line 1078 of file resowner.c.

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

Referenced by ReleaseCatCacheList().

1079 {
1080  if (!ResourceArrayRemove(&(owner->catlistrefarr), PointerGetDatum(list)))
1081  elog(ERROR, "catcache list reference %p is not owned by resource owner %s",
1082  list, owner->name);
1083 }
#define PointerGetDatum(X)
Definition: postgres.h:556
const char * name
Definition: resowner.c:119
#define ERROR
Definition: elog.h:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:304
#define elog(elevel,...)
Definition: elog.h:228
ResourceArray catlistrefarr
Definition: resowner.c:124

◆ ResourceOwnerForgetCatCacheRef()

void ResourceOwnerForgetCatCacheRef ( ResourceOwner  owner,
HeapTuple  tuple 
)

Definition at line 1043 of file resowner.c.

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

Referenced by ReleaseCatCache().

1044 {
1045  if (!ResourceArrayRemove(&(owner->catrefarr), PointerGetDatum(tuple)))
1046  elog(ERROR, "catcache reference %p is not owned by resource owner %s",
1047  tuple, owner->name);
1048 }
ResourceArray catrefarr
Definition: resowner.c:123
#define PointerGetDatum(X)
Definition: postgres.h:556
const char * name
Definition: resowner.c:119
#define ERROR
Definition: elog.h:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:304
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerForgetCryptoHash()

void ResourceOwnerForgetCryptoHash ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1419 of file resowner.c.

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

Referenced by pg_cryptohash_free().

1420 {
1421  if (!ResourceArrayRemove(&(owner->cryptohasharr), handle))
1422  elog(ERROR, "cryptohash context %p is not owned by resource owner %s",
1423  DatumGetPointer(handle), owner->name);
1424 }
const char * name
Definition: resowner.c:119
#define ERROR
Definition: elog.h:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:304
#define DatumGetPointer(X)
Definition: postgres.h:549
#define elog(elevel,...)
Definition: elog.h:228
ResourceArray cryptohasharr
Definition: resowner.c:132

◆ ResourceOwnerForgetDSM()

void ResourceOwnerForgetDSM ( ResourceOwner  owner,
dsm_segment  
)

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

1340 {
1341  if (!ResourceArrayRemove(&(owner->dsmarr), PointerGetDatum(seg)))
1342  elog(ERROR, "dynamic shared memory segment %u is not owned by resource owner %s",
1343  dsm_segment_handle(seg), owner->name);
1344 }
#define PointerGetDatum(X)
Definition: postgres.h:556
dsm_handle dsm_segment_handle(dsm_segment *seg)
Definition: dsm.c:1082
const char * name
Definition: resowner.c:119
#define ERROR
Definition: elog.h:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:304
#define elog(elevel,...)
Definition: elog.h:228
ResourceArray dsmarr
Definition: resowner.c:130

◆ ResourceOwnerForgetFile()

void ResourceOwnerForgetFile ( ResourceOwner  owner,
File  file 
)

Definition at line 1294 of file resowner.c.

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

Referenced by FileClose().

1295 {
1296  if (!ResourceArrayRemove(&(owner->filearr), FileGetDatum(file)))
1297  elog(ERROR, "temporary file %d is not owned by resource owner %s",
1298  file, owner->name);
1299 }
const char * name
Definition: resowner.c:119
#define ERROR
Definition: elog.h:43
#define FileGetDatum(file)
Definition: resowner.c:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:304
#define elog(elevel,...)
Definition: elog.h:228
ResourceArray filearr
Definition: resowner.c:129

◆ ResourceOwnerForgetJIT()

void ResourceOwnerForgetJIT ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1384 of file resowner.c.

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

Referenced by jit_release_context().

1385 {
1386  if (!ResourceArrayRemove(&(owner->jitarr), handle))
1387  elog(ERROR, "JIT context %p is not owned by resource owner %s",
1388  DatumGetPointer(handle), owner->name);
1389 }
const char * name
Definition: resowner.c:119
#define ERROR
Definition: elog.h:43
ResourceArray jitarr
Definition: resowner.c:131
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:304
#define DatumGetPointer(X)
Definition: postgres.h:549
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerForgetLock()

void ResourceOwnerForgetLock ( ResourceOwner  owner,
LOCALLOCK locallock 
)

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

995 {
996  int i;
997 
998  if (owner->nlocks > MAX_RESOWNER_LOCKS)
999  return; /* we have overflowed */
1000 
1001  Assert(owner->nlocks > 0);
1002  for (i = owner->nlocks - 1; i >= 0; i--)
1003  {
1004  if (locallock == owner->locks[i])
1005  {
1006  owner->locks[i] = owner->locks[owner->nlocks - 1];
1007  owner->nlocks--;
1008  return;
1009  }
1010  }
1011  elog(ERROR, "lock reference %p is not owned by resource owner %s",
1012  locallock, owner->name);
1013 }
#define MAX_RESOWNER_LOCKS
Definition: resowner.c:109
const char * name
Definition: resowner.c:119
#define ERROR
Definition: elog.h:43
#define Assert(condition)
Definition: c.h:800
LOCALLOCK * locks[MAX_RESOWNER_LOCKS]
Definition: resowner.c:136
#define elog(elevel,...)
Definition: elog.h:228
int i

◆ ResourceOwnerForgetPlanCacheRef()

void ResourceOwnerForgetPlanCacheRef ( ResourceOwner  owner,
CachedPlan plan 
)

Definition at line 1158 of file resowner.c.

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

Referenced by ReleaseCachedPlan().

1159 {
1160  if (!ResourceArrayRemove(&(owner->planrefarr), PointerGetDatum(plan)))
1161  elog(ERROR, "plancache reference %p is not owned by resource owner %s",
1162  plan, owner->name);
1163 }
#define PointerGetDatum(X)
Definition: postgres.h:556
const char * name
Definition: resowner.c:119
#define ERROR
Definition: elog.h:43
ResourceArray planrefarr
Definition: resowner.c:126
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:304
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerForgetRelationRef()

void ResourceOwnerForgetRelationRef ( ResourceOwner  owner,
Relation  rel 
)

Definition at line 1113 of file resowner.c.

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

Referenced by RelationDecrementReferenceCount().

1114 {
1115  if (!ResourceArrayRemove(&(owner->relrefarr), PointerGetDatum(rel)))
1116  elog(ERROR, "relcache reference %s is not owned by resource owner %s",
1117  RelationGetRelationName(rel), owner->name);
1118 }
ResourceArray relrefarr
Definition: resowner.c:125
#define PointerGetDatum(X)
Definition: postgres.h:556
const char * name
Definition: resowner.c:119
#define ERROR
Definition: elog.h:43
#define RelationGetRelationName(relation)
Definition: rel.h:491
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:304
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerForgetSnapshot()

void ResourceOwnerForgetSnapshot ( ResourceOwner  owner,
Snapshot  snapshot 
)

Definition at line 1248 of file resowner.c.

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

Referenced by UnregisterSnapshotFromOwner().

1249 {
1250  if (!ResourceArrayRemove(&(owner->snapshotarr), PointerGetDatum(snapshot)))
1251  elog(ERROR, "snapshot reference %p is not owned by resource owner %s",
1252  snapshot, owner->name);
1253 }
#define PointerGetDatum(X)
Definition: postgres.h:556
ResourceArray snapshotarr
Definition: resowner.c:128
const char * name
Definition: resowner.c:119
#define ERROR
Definition: elog.h:43
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:304
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerForgetTupleDesc()

void ResourceOwnerForgetTupleDesc ( ResourceOwner  owner,
TupleDesc  tupdesc 
)

Definition at line 1202 of file resowner.c.

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

Referenced by DecrTupleDescRefCount().

1203 {
1204  if (!ResourceArrayRemove(&(owner->tupdescarr), PointerGetDatum(tupdesc)))
1205  elog(ERROR, "tupdesc reference %p is not owned by resource owner %s",
1206  tupdesc, owner->name);
1207 }
#define PointerGetDatum(X)
Definition: postgres.h:556
const char * name
Definition: resowner.c:119
#define ERROR
Definition: elog.h:43
ResourceArray tupdescarr
Definition: resowner.c:127
static bool ResourceArrayRemove(ResourceArray *resarr, Datum value)
Definition: resowner.c:304
#define elog(elevel,...)
Definition: elog.h:228

◆ ResourceOwnerRememberBuffer()

void ResourceOwnerRememberBuffer ( ResourceOwner  owner,
Buffer  buffer 
)

Definition at line 947 of file resowner.c.

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

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

948 {
949  ResourceArrayAdd(&(owner->bufferarr), BufferGetDatum(buffer));
950 }
ResourceArray bufferarr
Definition: resowner.c:122
#define BufferGetDatum(buffer)
Definition: resowner.c:45
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:266

◆ ResourceOwnerRememberCatCacheListRef()

void ResourceOwnerRememberCatCacheListRef ( ResourceOwner  owner,
CatCList list 
)

Definition at line 1069 of file resowner.c.

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

Referenced by SearchCatCacheList().

1070 {
1072 }
#define PointerGetDatum(X)
Definition: postgres.h:556
ResourceArray catlistrefarr
Definition: resowner.c:124
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:266

◆ ResourceOwnerRememberCatCacheRef()

void ResourceOwnerRememberCatCacheRef ( ResourceOwner  owner,
HeapTuple  tuple 
)

Definition at line 1034 of file resowner.c.

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

Referenced by SearchCatCacheInternal(), and SearchCatCacheMiss().

1035 {
1036  ResourceArrayAdd(&(owner->catrefarr), PointerGetDatum(tuple));
1037 }
ResourceArray catrefarr
Definition: resowner.c:123
#define PointerGetDatum(X)
Definition: postgres.h:556
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:266

◆ ResourceOwnerRememberCryptoHash()

void ResourceOwnerRememberCryptoHash ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1410 of file resowner.c.

References ResourceOwnerData::cryptohasharr, and ResourceArrayAdd().

Referenced by pg_cryptohash_create().

1411 {
1412  ResourceArrayAdd(&(owner->cryptohasharr), handle);
1413 }
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:266
ResourceArray cryptohasharr
Definition: resowner.c:132

◆ ResourceOwnerRememberDSM()

void ResourceOwnerRememberDSM ( ResourceOwner  owner,
dsm_segment  
)

Definition at line 1330 of file resowner.c.

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

Referenced by dsm_create_descriptor(), and dsm_unpin_mapping().

1331 {
1332  ResourceArrayAdd(&(owner->dsmarr), PointerGetDatum(seg));
1333 }
#define PointerGetDatum(X)
Definition: postgres.h:556
ResourceArray dsmarr
Definition: resowner.c:130
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:266

◆ ResourceOwnerRememberFile()

void ResourceOwnerRememberFile ( ResourceOwner  owner,
File  file 
)

Definition at line 1285 of file resowner.c.

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

Referenced by RegisterTemporaryFile().

1286 {
1287  ResourceArrayAdd(&(owner->filearr), FileGetDatum(file));
1288 }
#define FileGetDatum(file)
Definition: resowner.c:43
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:266
ResourceArray filearr
Definition: resowner.c:129

◆ ResourceOwnerRememberJIT()

void ResourceOwnerRememberJIT ( ResourceOwner  owner,
Datum  handle 
)

Definition at line 1375 of file resowner.c.

References ResourceOwnerData::jitarr, and ResourceArrayAdd().

Referenced by llvm_create_context().

1376 {
1377  ResourceArrayAdd(&(owner->jitarr), handle);
1378 }
ResourceArray jitarr
Definition: resowner.c:131
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:266

◆ ResourceOwnerRememberLock()

void ResourceOwnerRememberLock ( ResourceOwner  owner,
LOCALLOCK locallock 
)

Definition at line 974 of file resowner.c.

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

Referenced by GrantLockLocal(), and LockReassignOwner().

975 {
976  Assert(locallock != NULL);
977 
978  if (owner->nlocks > MAX_RESOWNER_LOCKS)
979  return; /* we have already overflowed */
980 
981  if (owner->nlocks < MAX_RESOWNER_LOCKS)
982  owner->locks[owner->nlocks] = locallock;
983  else
984  {
985  /* overflowed */
986  }
987  owner->nlocks++;
988 }
#define MAX_RESOWNER_LOCKS
Definition: resowner.c:109
#define Assert(condition)
Definition: c.h:800
LOCALLOCK * locks[MAX_RESOWNER_LOCKS]
Definition: resowner.c:136

◆ ResourceOwnerRememberPlanCacheRef()

void ResourceOwnerRememberPlanCacheRef ( ResourceOwner  owner,
CachedPlan plan 
)

Definition at line 1149 of file resowner.c.

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

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

1150 {
1151  ResourceArrayAdd(&(owner->planrefarr), PointerGetDatum(plan));
1152 }
#define PointerGetDatum(X)
Definition: postgres.h:556
ResourceArray planrefarr
Definition: resowner.c:126
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:266

◆ ResourceOwnerRememberRelationRef()

void ResourceOwnerRememberRelationRef ( ResourceOwner  owner,
Relation  rel 
)

Definition at line 1104 of file resowner.c.

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

Referenced by RelationIncrementReferenceCount().

1105 {
1106  ResourceArrayAdd(&(owner->relrefarr), PointerGetDatum(rel));
1107 }
ResourceArray relrefarr
Definition: resowner.c:125
#define PointerGetDatum(X)
Definition: postgres.h:556
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:266

◆ ResourceOwnerRememberSnapshot()

void ResourceOwnerRememberSnapshot ( ResourceOwner  owner,
Snapshot  snapshot 
)

Definition at line 1239 of file resowner.c.

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

Referenced by RegisterSnapshotOnOwner().

1240 {
1241  ResourceArrayAdd(&(owner->snapshotarr), PointerGetDatum(snapshot));
1242 }
#define PointerGetDatum(X)
Definition: postgres.h:556
ResourceArray snapshotarr
Definition: resowner.c:128
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:266

◆ ResourceOwnerRememberTupleDesc()

void ResourceOwnerRememberTupleDesc ( ResourceOwner  owner,
TupleDesc  tupdesc 
)

Definition at line 1193 of file resowner.c.

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

Referenced by IncrTupleDescRefCount().

1194 {
1195  ResourceArrayAdd(&(owner->tupdescarr), PointerGetDatum(tupdesc));
1196 }
#define PointerGetDatum(X)
Definition: postgres.h:556
ResourceArray tupdescarr
Definition: resowner.c:127
static void ResourceArrayAdd(ResourceArray *resarr, Datum value)
Definition: resowner.c:266