Add assertion for failed alloc to palloc0() and palloc_extended()

Поиск
Список
Период
Сортировка
От Andreas Karlsson
Тема Add assertion for failed alloc to palloc0() and palloc_extended()
Дата
Msg-id 507e8eba-2035-4a12-a777-98199a66beb8@proxel.se
обсуждение исходный текст
Ответы Re: Add assertion for failed alloc to palloc0() and palloc_extended()
Список 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

Вложения

В списке pgsql-hackers по дате отправления: