Re: Extended Statistics set/restore/clear functions.
Вложения
В списке pgsql-hackers по дате отправления:
| От | Michael Paquier |
|---|---|
| Тема | Re: Extended Statistics set/restore/clear functions. |
| Дата | |
| Msg-id | aW68-vC2fkQ54pLC@paquier.xyz обсуждение исходный текст |
| Ответ на | Re: Extended Statistics set/restore/clear functions. (Chao Li <li.evan.chao@gmail.com>) |
| Список | pgsql-hackers |
On Mon, Jan 19, 2026 at 04:56:25PM +0800, Chao Li wrote: > Should tuples returned by SearchSysCacheCopy1() always be explicitly > freed with heap_freetuple()? I’ve long had the understanding that > the answer is “yes”. > > However, recently I’ve seen some patches addressing apparent memory > leaks deemed unnecessary on the grounds that the surrounding memory > context would clean things up anyway. That made me unsure whether > the same reasoning is considered acceptable for tuples returned by > SearchSysCacheCopy1(), or whether the expectation is still that > callers should free them explicitly. My guess is that it depends on the context where a given function is called. If for example SearchSysCacheCopy1() is used in something in a tight loop, freeing memory is justified to me. A SQL function would have its execution memory context pretty quickly, though, so a free() would make less sense. So there is no strict rule on the matter, one or other other may make more sense. -- Michael
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера