aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2019-10-06 12:06:30 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2019-10-06 12:06:30 -0400
commitac12ab06a96179d44046494bc76ec53f30b5d30a (patch)
treeec9e92d2fff80e3402bbf86ca845a43fa0222460 /src/tutorial
parent36425ece5d6c78177cdc1453a9925a0bb85da59f (diff)
downloadpostgresql-ac12ab06a96179d44046494bc76ec53f30b5d30a.tar.gz
postgresql-ac12ab06a96179d44046494bc76ec53f30b5d30a.zip
Avoid trying to release a List's initial allocation via repalloc().
Commit 1cff1b95a included some code that supposed it could repalloc() a memory chunk to a smaller size without risk of the chunk moving. That was not a great idea, because it depended on undocumented behavior of AllocSetRealloc, which commit c477f3e44 changed thereby breaking it. (Not to mention that this code ought to work with other memory context types, which might not work the same...) So get rid of the repalloc calls, and instead just wipe the now-unused ListCell array and/or tell Valgrind it's NOACCESS, as if we'd freed it. In cases where the initial list allocation had been quite large, this could represent an annoying waste of space. In principle we could ameliorate that by allocating the initial cell array separately when it exceeds some threshold. But that would complicate new_list() which is hot code, and the returns would materialize only in narrow cases. On balance I don't think it'd be worth it. Discussion: https://postgr.es/m/17059.1570208426@sss.pgh.pa.us
Diffstat (limited to 'src/tutorial')
0 files changed, 0 insertions, 0 deletions