| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | David Rowley <dgrowleyml(at)gmail(dot)com> |
| 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-08-29 15:39:21 |
| Message-ID: | 3209100.1661787561@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Got it: sizeof(SlabBlock) isn't a multiple of MAXALIGN,
(gdb) p sizeof(SlabBlock)
$4 = 20
but this coding requires it to be:
#define SlabBlockGetChunk(slab, block, idx) \
((MemoryChunk *) ((char *) (block) + sizeof(SlabBlock) \
+ (idx * slab->fullChunkSize)))
So what you actually need to do is add some alignment padding to
SlabBlock. I'd suggest reverting df0f4feef as it seems to be
a red herring.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tomas Vondra | 2022-08-29 15:39:52 | Re: Reducing the chunk header sizes on all memory context types |
| Previous Message | Tom Lane | 2022-08-29 15:31:40 | Re: Reducing the chunk header sizes on all memory context types |