Add assertion for failed alloc to palloc0() and palloc_extended() - Mailing list pgsql-hackers

From Andreas Karlsson
Subject Add assertion for failed alloc to palloc0() and palloc_extended()
Date
Msg-id 507e8eba-2035-4a12-a777-98199a66beb8@proxel.se
Whole thread Raw
Responses Re: Add assertion for failed alloc to palloc0() and palloc_extended()
List pgsql-hackers
Hi,

I noticed that we have Assert(ret != NULL) in palloc() but not in 
palloc0() so for consistency I decided to add it. I also added an 
assertion that the MCXT_ALLOC_NO_OOM flag is set if alloc() returns
NULL to palloc_extended().

I feel that this might be useful since while palloc() is much more 
common the OOM which causes alloc() to incorrectly return NULL could in 
theory happen in any of the three functions.

Andreas

Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER
Next
From: Thomas Munro
Date:
Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER