Do we want a xmalloc or similar function in the Backend?

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Do we want a xmalloc or similar function in the Backend?
Дата
Msg-id 201206191617.29711.andres@2ndquadrant.com
обсуждение исходный текст
Ответы Re: Do we want a xmalloc or similar function in the Backend?
Re: Do we want a xmalloc or similar function in the Backend?
Список pgsql-hackers
Hi,

There are 70+ calls of malloc in the backend in the form of

type* foo = malloc(sizeof(...));
if(!foo)  elog(ERROR, "could not allocate memory");

which is a bit annoying to write at times. Would somebody argue against 
introducing a function that does the above named xmalloc() or malloc_or_die()?

Greetings,

Andres
-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services


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