SPI_psprintf and SPI_pstrdup

Поиск
Список
Период
Сортировка
От Jacob Rief
Тема SPI_psprintf and SPI_pstrdup
Дата
Msg-id 1177447864.4530.21.camel@ruben
обсуждение исходный текст
Ответы Re: SPI_psprintf and SPI_pstrdup
Re: SPI_psprintf and SPI_pstrdup
Список pgsql-patches
The Apache runtime library, which is using a similar concept for
allocating heap-based memory out of a pool, has some since utility
functions, named apr_psprintf and apr_pstrdup.
These functions allocate a memory-block out of a pool and print a
formatted string into that block, or duplicate a string respectively.

Since such useful functions are missing in PostgreSQL's Server
Programming Interface, I created two similar functions:

char *SPI_psprintf(const char *fmt, ...);
allocates a block of memory out of the memory pool and prints a
formatted string into it

SPI_pstrdup(const char *src);
allocates a block of memory out of the memory pool and copies an
existing string into it.

I includes a patch containing these functions to be applied onto version
8.2.3 and 8.2.4. I would appreciate seeing it in one of the next
versions.

Jacob Rief


Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Full page writes improvement, code update
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: SPI_psprintf and SPI_pstrdup