| 4082 | #define INITRELCACHESIZE 400 |
| 4083 | |
| 4084 | void |
| 4085 | RelationCacheInitialize(void) |
| 4086 | { |
| 4087 | HASHCTL ctl; |
| 4088 | int allocsize; |
| 4089 | |
| 4090 | /* |
| 4091 | * make sure cache memory context exists |
| 4092 | */ |
| 4093 | if (!CacheMemoryContext) |
| 4094 | CreateCacheMemoryContext(); |
| 4095 | |
| 4096 | /* |
| 4097 | * create hashtable that indexes the relcache |
| 4098 | */ |
| 4099 | ctl.keysize = sizeof(Oid); |
| 4100 | ctl.entrysize = sizeof(RelIdCacheEnt); |
| 4101 | RelationIdCache = hash_create("Relcache by OID", INITRELCACHESIZE, |
| 4102 | &ctl, HASH_ELEM | HASH_BLOBS); |
| 4103 | |
| 4104 | /* |
| 4105 | * reserve enough in_progress_list slots for many cases |
| 4106 | */ |
| 4107 | allocsize = 4; |
| 4108 | in_progress_list = |
| 4109 | MemoryContextAlloc(CacheMemoryContext, |
| 4110 | allocsize * sizeof(*in_progress_list)); |
| 4111 | in_progress_list_maxlen = allocsize; |
| 4112 | |
| 4113 | /* |
| 4114 | * relation mapper needs to be initialized too |
| 4115 | */ |
| 4116 | RelationMapInitialize(); |
| 4117 | } |
| 4118 | |
| 4119 | /* |
| 4120 | * RelationCacheInitializePhase2 |
no test coverage detected