Re: pointer scope and memory contexts

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pointer scope and memory contexts
Дата
Msg-id 15359.1225978088@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pointer scope and memory contexts  ("Tim Keitt" <tkeitt@keittlab.org>)
Список pgsql-hackers
"Tim Keitt" <tkeitt@keittlab.org> writes:
> [questions]

Switching memory contexts, in itself, only switches which context a bare
palloc() will allocate from (as opposed to MemoryContextAlloc).  It
cannot have some magic impact on the validity of existing pointers.

> One last question: if I call SPI_finish, on the first call, do I need
> to switch contexts in the per-call section? (I saw some example code
> that suggested one needs to switch contexts back to
> multi_call_memory_ctx after SPI_finish.)

I believe SPI_finish will switch back to the context that was current
when SPI_connect was called.
        regards, tom lane


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

Предыдущее
От: "Jaime Casanova"
Дата:
Сообщение: Re: regression in analyze
Следующее
От: Tom Lane
Дата:
Сообщение: Re: plperl needs upgrade for Fedora 10