Re: Parent/child context relation in pg_get_backend_memory_contexts() - Mailing list pgsql-hackers

From David Rowley
Subject Re: Parent/child context relation in pg_get_backend_memory_contexts()
Date
Msg-id CAApHDvogQ1=VEyu312Dm7kUB7EyaZ1EtU0f3mPBfaU4OQrcwfg@mail.gmail.com
Whole thread Raw
In response to Re: Parent/child context relation in pg_get_backend_memory_contexts()  (Melih Mutlu <m.melihmutlu@gmail.com>)
Responses Re: Parent/child context relation in pg_get_backend_memory_contexts()
List pgsql-hackers
On Tue, 23 Jul 2024 at 22:14, Melih Mutlu <m.melihmutlu@gmail.com> wrote:
> Fixed the name. Also I needed to cast parameters when calling that function as below to get rid of some warnings.
>
> +       get_memory_context_name_and_ident(context,
> +                                                                         (const char **)&name,
> +                                                                         (const char **) &ident);

I ended up fixing that another way as the above seems to be casting
away the const for those variables. Instead, I changed the signature
of the function to:

static void get_memory_context_name_and_ident(MemoryContext context,
const char **const name,  const char **const ident);

which I think takes into account for the call site variables being
defined as "const char *".

David



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Slow catchup of 2PC (twophase) transactions on replica in LR
Next
From: Amit Kapila
Date:
Subject: Re: pg_upgrade and logical replication