aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/cluster.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-03-30 13:53:33 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-03-30 13:53:33 -0400
commit1bb9e731e17b79f5b1c6713159812adfcf4f6495 (patch)
tree1f72a81130907c2bdfa96e6e2b9651b415f909b4 /src/backend/commands/cluster.c
parentc79f6df75dd381dbc387326f8155402992524124 (diff)
downloadpostgresql-1bb9e731e17b79f5b1c6713159812adfcf4f6495.tar.gz
postgresql-1bb9e731e17b79f5b1c6713159812adfcf4f6495.zip
Improve out-of-memory error reports by including memory context name.
Add the target context's name to the errdetail field of "out of memory" errors in mcxt.c. Per discussion, this seems likely to be useful to help narrow down the cause of a reported failure, and it costs little. Also, now that context names are required to be compile-time constants in all cases, there's little reason to be concerned about security issues from exposing these names to users. (Because of such concerns, we are *not* including the context "ident" field.) In passing, add unlikely() markers to the allocation-failed tests, just to be sure the compiler is on the right page about that. Also, in palloc and friends, copy CurrentMemoryContext into a local variable, as that's almost surely cheaper to reference than a global. Discussion: https://postgr.es/m/1099.1522285628@sss.pgh.pa.us
Diffstat (limited to 'src/backend/commands/cluster.c')
0 files changed, 0 insertions, 0 deletions