* InitializeTableSpaceCache * Initialize the tablespace cache. */
| 67 | * Initialize the tablespace cache. |
| 68 | */ |
| 69 | static void |
| 70 | InitializeTableSpaceCache(void) |
| 71 | { |
| 72 | HASHCTL ctl; |
| 73 | |
| 74 | /* Initialize the hash table. */ |
| 75 | ctl.keysize = sizeof(Oid); |
| 76 | ctl.entrysize = sizeof(TableSpaceCacheEntry); |
| 77 | TableSpaceCacheHash = |
| 78 | hash_create("TableSpace cache", 16, &ctl, |
| 79 | HASH_ELEM | HASH_BLOBS); |
| 80 | |
| 81 | /* Make sure we've initialized CacheMemoryContext. */ |
| 82 | if (!CacheMemoryContext) |
| 83 | CreateCacheMemoryContext(); |
| 84 | |
| 85 | /* Watch for invalidation events. */ |
| 86 | CacheRegisterSyscacheCallback(TABLESPACEOID, |
| 87 | InvalidateTableSpaceCacheCallback, |
| 88 | (Datum) 0); |
| 89 | } |
| 90 | |
| 91 | /* |
| 92 | * get_tablespace |
no test coverage detected