Re: why declare arg as a array in FunctionCallInfoData structure
В списке pgsql-hackers по дате отправления:
| От | Martijn van Oosterhout |
|---|---|
| Тема | Re: why declare arg as a array in FunctionCallInfoData structure |
| Дата | |
| Msg-id | 20090202083339.GA2610@svana.org обсуждение исходный текст |
| Ответ на | why declare arg as a array in FunctionCallInfoData structure ("Tao Ma" <feng_eden@163.com>) |
| Список | pgsql-hackers |
On Mon, Feb 02, 2009 at 03:16:01PM +0800, Tao Ma wrote: > hi, > > When I read the postgresql codes, I noticed that the FunctionCallInfoData > structure(declared in the src/include/fmgr.h) contains two arrays 'arg' and > 'argnull'. > Why don't you declare it as a pointer and allocate the memory from heap? It > saves more momery if 'arg' and 'argnull' declares as pointer type. I imagaine it's because most of the time this structure would be allocated on the stack, where allocation is essentially free. Having to allocate two arrays from the heap would be slower. Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Please line up in a tree and maintain the heap invariant while > boarding. Thank you for flying nlogn airlines.
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера