git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: ba57dcf) | patch
Add more assertions in palloc0() and palloc_extended()
Tue, 4 Mar 2025 01:53:10 +0000 (10:53 +0900)
Tue, 4 Mar 2025 01:53:10 +0000 (10:53 +0900)
commit 40d3f8274499cb1dd349f60f2e5915f907acce6e
Add more assertions in palloc0() and palloc_extended()

palloc() includes an assertion checking that an alloc() implementation
never returns NULL for all MemoryContextMethods.

This commit adds a similar assertion in palloc0(). In palloc_extend(),
a different assertion is added, checking that MCXT_ALLOC_NO_OOM is set
when an alloc() routine returns NULL. These additions can be useful to
catch errors when implementing a new set of MemoryContextMethods
routines.

Author: Andreas Karlsson <andreas@proxel.se>
Discussion: https://postgr.es/m/507e8eba-2035-4a12-a777-98199a66beb8@proxel.se
src/backend/utils/mmgr/mcxt.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /