Re: Parent/child context relation in pg_get_backend_memory_contexts()

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Melih Mutlu <m(dot)melihmutlu(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Parent/child context relation in pg_get_backend_memory_contexts()
Date: 2024-07-25 03:08:47
Message-ID: CAApHDvogQ1=VEyu312Dm7kUB7EyaZ1EtU0f3mPBfaU4OQrcwfg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 23 Jul 2024 at 22:14, Melih Mutlu <m(dot)melihmutlu(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2024-07-25 03:11:22 Re: pg_upgrade and logical replication
Previous Message Amit Kapila 2024-07-25 03:08:38 Re: Slow catchup of 2PC (twophase) transactions on replica in LR