| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера