Re: Is custom MemoryContext prohibited? - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Is custom MemoryContext prohibited?
Date
Msg-id CA+TgmoZUAgkD9oqOedt=Ykvi_DW6J+drtU9Bjtn4omSnO_hN2g@mail.gmail.com
Whole thread Raw
In response to Re: Is custom MemoryContext prohibited?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Is custom MemoryContext prohibited?
List pgsql-hackers
On Wed, Feb 5, 2020 at 10:09 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> an enum field right in the context.  You'll have to do an extra step to
> discover the context's type, and if you jump to the wrong conclusion
> and do, say,
>         p *(AllocSetContext *) ptr_value
> when it's really some other context type, there won't be anything
> as obvious as "type = T_GenerationContext" in what is printed to
> tell you you were wrong.

Doesn't the proposed magic number address this concern?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Is custom MemoryContext prohibited?
Next
From: Konstantin Knizhnik
Date:
Subject: Re: [Proposal] Global temporary tables