| From: | David Rowley <dgrowleyml(at)gmail(dot)com> | 
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
| Cc: | Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, 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-09-01 00:31:58 | 
| Message-ID: | CAApHDvoKg1Nf1GZgaL9WeS+srja2+UBgFxjYDkO-A2_XHbfU-A@mail.gmail.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On Thu, 1 Sept 2022 at 12:23, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Is there reason to think we can't validate headers enough to catch
> clobbers?
For non-sentinel chunks, the next byte after the end of the chunk will
be storing the block offset for the following chunk.  I think:
if (block != MemoryChunkGetBlock(chunk))
elog(WARNING, "problem in alloc set %s: bad block offset for chunk %p
in block %p",
name, chunk, block);
should catch those.
Maybe we should just consider always making room for a sentinel for
chunks that are on dedicated blocks. At most that's an extra 8 bytes
in some allocation that's either over 1024 or 8192 (depending on
maxBlockSize).
David
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Paquier | 2022-09-01 00:32:38 | Re: [PATCH] Add native windows on arm64 support | 
| Previous Message | Tom Lane | 2022-09-01 00:23:41 | Re: Reducing the chunk header sizes on all memory context types |