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?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Do we want a xmalloc or similar function in the Backend?  (Robert Haas <robertmhaas@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH 10/16] Introduce the concept that wal has a 'origin' node
Следующее
От: Andres Freund
Дата:
Сообщение: Re: [PATCH 10/16] Introduce the concept that wal has a 'origin' node