mirror of
https://github.com/postgres/postgres.git
synced 2026-04-21 22:28:15 -04:00
Reduce presence of syscache.h in src/include/
ee642cccc4 has added syscache.h in inval.h and objectaddress.h,
enlarging by a lot the footprint of this header, particularly via
objectaddress.h. A change in syscache.h would cause a lot more files to
be recompiled.
This commit reduces the presence of syscache.h by switching to a direct
use of syscache_ids.h in inval.h and objectaddress.h, where the enum
SysCacheIdentifier is defined. genbki.pl gains an #ifndef block for
this header, so as its inclusion is more controlled.
Reported-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/vlcexdcimsmvu3aplt2yxpfndkgtuvjsrms2fdl46rbw3k2kug@drspkoxlaije
This commit is contained in:
parent
2cff363715
commit
e0fa5bd146
3 changed files with 10 additions and 4 deletions
|
|
@ -795,7 +795,10 @@ print $fk_info "};\n\n#endif\t\t\t\t\t\t\t/* SYSTEM_FK_INFO_H */\n";
|
|||
# Now generate syscache info
|
||||
|
||||
print_boilerplate($syscache_ids_fh, "syscache_ids.h", "SysCache identifiers");
|
||||
print $syscache_ids_fh "typedef enum SysCacheIdentifier
|
||||
print $syscache_ids_fh "#ifndef SYSCACHE_IDS_H
|
||||
#define SYSCACHE_IDS_H
|
||||
|
||||
typedef enum SysCacheIdentifier
|
||||
{
|
||||
\tSYSCACHEID_INVALID = -1,\n";
|
||||
|
||||
|
|
@ -833,7 +836,10 @@ foreach my $syscache (sort keys %syscaches)
|
|||
}
|
||||
|
||||
print $syscache_ids_fh "} SysCacheIdentifier;\n";
|
||||
print $syscache_ids_fh "#define SysCacheSize ($last_syscache + 1)\n";
|
||||
print $syscache_ids_fh "#define SysCacheSize ($last_syscache + 1)\n\n";
|
||||
|
||||
# Closing boilerplate for syscache_ids.h
|
||||
print $syscache_ids_fh "#endif\t\t\t\t\t\t\t/* SYSCACHE_IDS_H */\n";
|
||||
|
||||
print $syscache_info_fh "};\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@
|
|||
#define OBJECTADDRESS_H
|
||||
|
||||
#include "access/htup.h"
|
||||
#include "catalog/syscache_ids.h"
|
||||
#include "nodes/parsenodes.h"
|
||||
#include "storage/lockdefs.h"
|
||||
#include "utils/relcache.h"
|
||||
#include "utils/syscache.h"
|
||||
|
||||
/*
|
||||
* An ObjectAddress represents a database object of any type.
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@
|
|||
#define INVAL_H
|
||||
|
||||
#include "access/htup.h"
|
||||
#include "catalog/syscache_ids.h"
|
||||
#include "storage/relfilelocator.h"
|
||||
#include "utils/relcache.h"
|
||||
#include "utils/syscache.h"
|
||||
|
||||
extern PGDLLIMPORT int debug_discard_caches;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue