1/*-------------------------------------------------------------------------
2 *
3 * resowner_private.h
4 * POSTGRES resource owner private definitions.
5 *
6 * See utils/resowner/README for more info.
7 *
8 *
9 * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
10 * Portions Copyright (c) 1994, Regents of the University of California
11 *
12 * src/include/utils/resowner_private.h
13 *
14 *-------------------------------------------------------------------------
15 */
16#ifndef RESOWNER_PRIVATE_H
17#define RESOWNER_PRIVATE_H
18
19#include "storage/dsm.h"
20#include "storage/fd.h"
21#include "storage/lock.h"
22#include "utils/catcache.h"
23#include "utils/plancache.h"
24#include "utils/resowner.h"
25#include "utils/snapshot.h"
26
27
28/* support for buffer refcount management */
29extern void ResourceOwnerEnlargeBuffers(ResourceOwner owner);
30extern void ResourceOwnerRememberBuffer(ResourceOwner owner, Buffer buffer);
31extern void ResourceOwnerForgetBuffer(ResourceOwner owner, Buffer buffer);
32
33/* support for local lock management */
34extern void ResourceOwnerRememberLock(ResourceOwner owner, LOCALLOCK *locallock);
35extern void ResourceOwnerForgetLock(ResourceOwner owner, LOCALLOCK *locallock);
36
37/* support for catcache refcount management */
38extern void ResourceOwnerEnlargeCatCacheRefs(ResourceOwner owner);
39extern void ResourceOwnerRememberCatCacheRef(ResourceOwner owner,
40 HeapTuple tuple);
41extern void ResourceOwnerForgetCatCacheRef(ResourceOwner owner,
42 HeapTuple tuple);
43extern void ResourceOwnerEnlargeCatCacheListRefs(ResourceOwner owner);
44extern void ResourceOwnerRememberCatCacheListRef(ResourceOwner owner,
45 CatCList *list);
46extern void ResourceOwnerForgetCatCacheListRef(ResourceOwner owner,
47 CatCList *list);
48
49/* support for relcache refcount management */
50extern void ResourceOwnerEnlargeRelationRefs(ResourceOwner owner);
51extern void ResourceOwnerRememberRelationRef(ResourceOwner owner,
52 Relation rel);
53extern void ResourceOwnerForgetRelationRef(ResourceOwner owner,
54 Relation rel);
55
56/* support for plancache refcount management */
57extern void ResourceOwnerEnlargePlanCacheRefs(ResourceOwner owner);
58extern void ResourceOwnerRememberPlanCacheRef(ResourceOwner owner,
59 CachedPlan *plan);
60extern void ResourceOwnerForgetPlanCacheRef(ResourceOwner owner,
61 CachedPlan *plan);
62
63/* support for tupledesc refcount management */
64extern void ResourceOwnerEnlargeTupleDescs(ResourceOwner owner);
65extern void ResourceOwnerRememberTupleDesc(ResourceOwner owner,
66 TupleDesc tupdesc);
67extern void ResourceOwnerForgetTupleDesc(ResourceOwner owner,
68 TupleDesc tupdesc);
69
70/* support for snapshot refcount management */
71extern void ResourceOwnerEnlargeSnapshots(ResourceOwner owner);
72extern void ResourceOwnerRememberSnapshot(ResourceOwner owner,
73 Snapshot snapshot);
74extern void ResourceOwnerForgetSnapshot(ResourceOwner owner,
75 Snapshot snapshot);
76
77/* support for temporary file management */
78extern void ResourceOwnerEnlargeFiles(ResourceOwner owner);
79extern void ResourceOwnerRememberFile(ResourceOwner owner,
80 File file);
81extern void ResourceOwnerForgetFile(ResourceOwner owner,
82 File file);
83
84/* support for dynamic shared memory management */
85extern void ResourceOwnerEnlargeDSMs(ResourceOwner owner);
86extern void ResourceOwnerRememberDSM(ResourceOwner owner,
87 dsm_segment *);
88extern void ResourceOwnerForgetDSM(ResourceOwner owner,
89 dsm_segment *);
90
91/* support for JITContext management */
92extern void ResourceOwnerEnlargeJIT(ResourceOwner owner);
93extern void ResourceOwnerRememberJIT(ResourceOwner owner,
94 Datum handle);
95extern void ResourceOwnerForgetJIT(ResourceOwner owner,
96 Datum handle);
97
98#endif /* RESOWNER_PRIVATE_H */
99