File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,11 @@ pathman_xact_cb(XactEvent event, void *arg)
314314 * -------------------
315315 */
316316
317+ #if PG_VERSION_NUM >= 150000
318+ static shmem_request_hook_type prev_shmem_request_hook = NULL ;
319+ static void pg_pathman_shmem_request (void );
320+ #endif
321+
317322/* Set initial values for all Postmaster's forks */
318323void
319324_PG_init (void )
@@ -326,7 +331,12 @@ _PG_init(void)
326331 }
327332
328333 /* Request additional shared resources */
334+ #if PG_VERSION_NUM >= 150000
335+ prev_shmem_request_hook = shmem_request_hook ;
336+ shmem_request_hook = pg_pathman_shmem_request ;
337+ #else
329338 RequestAddinShmemSpace (estimate_pathman_shmem_size ());
339+ #endif
330340
331341 /* Assign pg_pathman's initial state */
332342 pathman_init_state .pg_pathman_enable = DEFAULT_PATHMAN_ENABLE ;
@@ -363,6 +373,17 @@ _PG_init(void)
363373#endif
364374}
365375
376+ #if PG_VERSION_NUM >= 150000
377+ static void
378+ pg_pathman_shmem_request (void )
379+ {
380+ if (prev_shmem_request_hook )
381+ prev_shmem_request_hook ();
382+
383+ RequestAddinShmemSpace (estimate_pathman_shmem_size ());
384+ }
385+ #endif
386+
366387/* Get cached PATHMAN_CONFIG relation Oid */
367388Oid
368389get_pathman_config_relid (bool invalid_is_ok )
You can’t perform that action at this time.
0 commit comments