summaryrefslogtreecommitdiff
path: root/src/tutorial/funcs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2025-08-02 18:31:39 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2025-08-02 21:59:46 -0400
commit9e9190154ef204a4e814dcc99f763398f7094667 (patch)
treecdaba84f20fb04e0bb67ac56abee2e0a78dc820f /src/tutorial/funcs.c
parentbb049a79d3447e97c0d4fa220600c423c4474bf9 (diff)
Fix MemoryContextAllocAligned's interaction with Valgrind.
Arrange that only the "aligned chunk" part of the allocated space is included in a Valgrind vchunk. This suppresses complaints about that vchunk being possibly lost because PG is retaining only pointers to the aligned chunk. Also make sure that trailing wasted space is marked NOACCESS. As a tiny performance improvement, arrange that MCXT_ALLOC_ZERO zeroes only the returned "aligned chunk", not the wasted padding space. In passing, fix GetLocalBufferStorage to use MemoryContextAllocAligned instead of rolling its own implementation, which was equally broken according to Valgrind. Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/285483.1746756246@sss.pgh.pa.us
Diffstat (limited to 'src/tutorial/funcs.c')
0 files changed, 0 insertions, 0 deletions