| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | David Rowley <dgrowleyml(at)gmail(dot)com> | 
| Cc: | Andres Freund <andres(at)anarazel(dot)de>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Yura Sokolov <y(dot)sokolov(at)postgrespro(dot)ru>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org> | 
| Subject: | Re: Reducing the chunk header sizes on all memory context types | 
| Date: | 2022-10-06 18:19:21 | 
| Message-ID: | 2910981.1665080361@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
One more thing: based on what I saw in working with my pending guc.c
changes, the assertions in GetMemoryChunkMethodID are largely useless
for detecting bogus pointers.  I think we should do something more
like the attached, which will result in a clean failure if the method
ID bits are invalid.
I'm a little tempted also to rearrange the MemoryContextMethodID enum
so that likely bit patterns like 000 are not valid IDs.
While I didn't change it here, I wonder why GetMemoryChunkMethodID is
publicly exposed at all.  AFAICS it could be static inside mcxt.c.
regards, tom lane
| Attachment | Content-Type | Size | 
|---|---|---|
| more-mcxt-robustness-1.patch | text/x-diff | 4.9 KB | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2022-10-06 18:26:07 | Re: list of acknowledgments for PG15 | 
| Previous Message | Vasya | 2022-10-06 18:04:44 | [PATCH] Check system cache invalidations before each command in transaction |