1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Change SearchSysCache coding conventions so that a reference count is

maintained for each cache entry.  A cache entry will not be freed until
the matching ReleaseSysCache call has been executed.  This eliminates
worries about cache entries getting dropped while still in use.  See
my posting to pg-hackers of even date for more info.
This commit is contained in:
Tom Lane
2000-11-16 22:30:52 +00:00
parent cff23842a4
commit a933ee38bb
95 changed files with 2672 additions and 2314 deletions

View File

@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: syscache.h,v 1.26 2000/06/17 04:56:29 tgl Exp $
* $Id: syscache.h,v 1.27 2000/11/16 22:30:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -57,12 +57,22 @@
#define TYPENAME 26
#define TYPEOID 27
extern void zerocaches(void);
extern void InitCatalogCache(void);
extern HeapTuple SearchSysCacheTuple(int cacheId,
extern HeapTuple SearchSysCache(int cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);
extern HeapTuple SearchSysCacheTupleCopy(int cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);
extern void ReleaseSysCache(HeapTuple tuple);
/* convenience routines */
extern HeapTuple SearchSysCacheCopy(int cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);
extern Oid GetSysCacheOid(int cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);
/* macro for just probing for existence of a tuple via the syscache */
#define SearchSysCacheExists(c,k1,k2,k3,k4) \
OidIsValid(GetSysCacheOid(c,k1,k2,k3,k4))
extern Datum SysCacheGetAttr(int cacheId, HeapTuple tup,
AttrNumber attributeNumber, bool *isNull);