Re: MemoryContext and NodeTags

From: Thomas Hallgren <thomas(dot)hallgren(at)home(dot)se>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: MemoryContext and NodeTags
Date: 2005-10-17 14:29:44
Message-ID: 4353B558.7040705@home.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

tgl(at)sss(dot)pgh(dot)pa(dot)us wrote:
> Thomas Hallgren <thomas(dot)hallgren(at)home(dot)se> writes:
>
>> I have a proposal:
>> The NodeTag T_MemoryContext has the value of 600 and the next occupied
>> entry is T_Value which is 650.
>> - Reserve half of that range for PostgreSQL specific contexts (today you
>> only use one), and the other half for custom contexts.
>>
>
> OK.
>
>
>> - Accept patches to nodes/nodes.h for new custom tags (properly
>> motivated of course).
>>
>
> No. Define 'em yourself.
>
OK, I can do that. But I have a couple of reasons why I think that it
would be a good idea to get my definitions into node.h:
- If more module authors want to do similar things, they would not risk
defining overlapping tags.
- The NodeTag is an enum. Code that defines tags that are supposed to
"fit in" becomes ugly.
- The IsA macro can be used.
- You (PostgreSQL core) want full control over the tags. If all tags are
in nodes.h, you can move tags to other number ranges without creating a
hassle for people like me.

Regards,
Thomas Hallgren.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-10-17 14:42:05 Re: MemoryContext and NodeTags
Previous Message Tom Lane 2005-10-17 14:13:55 Re: MemoryContext and NodeTags