Commit 40d3f82
committed
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.se1 parent ba57dcf commit 40d3f82
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1356 | 1356 | | |
1357 | 1357 | | |
1358 | 1358 | | |
1359 | | - | |
| 1359 | + | |
| 1360 | + | |
1360 | 1361 | | |
1361 | 1362 | | |
1362 | 1363 | | |
| |||
1379 | 1380 | | |
1380 | 1381 | | |
1381 | 1382 | | |
| 1383 | + | |
| 1384 | + | |
1382 | 1385 | | |
1383 | 1386 | | |
1384 | 1387 | | |
| |||
0 commit comments