| From: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
|---|---|
| To: | Michael Paquier <michael(at)paquier(dot)xyz> |
| Cc: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | Re: pgsql: Convert all remaining subsystems to use the new shmem allocation |
| Date: | 2026-04-06 12:31:28 |
| Message-ID: | e6632ba1-4f48-4dfe-80d7-06c0253cc720@iki.fi |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
On 06/04/2026 08:41, Michael Paquier wrote:
> On Sun, Apr 05, 2026 at 11:27:44PM +0000, Heikki Linnakangas wrote:
>> Convert all remaining subsystems to use the new shmem allocation API
>>
>> This removes all remaining uses of ShmemInitStruct() and
>> ShmemInitHash() from built-in code.
>>
>> src/backend/utils/misc/injection_point.c | 57 ++++---
>
> drongo, that compiles without USE_INJECTION_POINTS, is complaining
> about this bit around line 240:
> const ShmemCallbacks InjectionPointShmemCallbacks = {
> #ifdef USE_INJECTION_POINTS
> .request_fn = InjectionPointShmemRequest,
> .init_fn = InjectionPointShmemInit,
> #endif
> };
>
> Link:
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=drongo&dt=2026-04-06%2004%3A09%3A20
> And the error:
> ../pgsql/src/backend/utils/misc/injection_point.c(240): error C2059: syntax error: '}'
Oh, I didn't realize that that an empty initializer isn't allowed.
> Why not putting the whole InjectionPointShmemCallbacks inside a
> USE_INJECTION_POINTS block? We should not care about shmem
> allocations when --enable-injection-points is not used.
>
> subsystemlist.h expects the callbacks to always be defined, so your
> intention is to have no ifdefs there. Still, it seems a bit pointless
> to me to define callbacks we are not going to use depending on the
> build options evoked? Attached is one idea, which I doubt you'll
> like. :)
Looks perfectly fine to me, I'll push that. Thanks!
- Heikki
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Heikki Linnakangas | 2026-04-06 12:38:53 | Re: pgsql: Introduce a new mechanism for registering shared memory areas |
| Previous Message | Robert Haas | 2026-04-06 11:57:03 | pgsql: Add pg_stash_advice contrib module. |