Re: c extension
От | Joe Conway |
---|---|
Тема | Re: c extension |
Дата | |
Msg-id | 41890A80.6020304@joeconway.com обсуждение исходный текст |
Ответ на | Re: c extension (Kjetil Haaland <kjetil.haaland@student.uib.no>) |
Ответы |
Re: c extension
Re: c extension |
Список | pgsql-novice |
Kjetil Haaland wrote: > Many thanks for good answer. I have also allocated memory for a table of > integers in the same file, and this table seems to work fine, i can print out > values from it without any problems. > > Is there any good reason it should work with integers and not with characters? Not sure -- sheer luck ;-) > In what memory context should it be created to last until the user logs out? Probably TopMemoryContext "TopMemoryContext --- this is the actual top level of the context tree; every other context is a direct or indirect child of this one. Allocating here is essentially the same as "malloc", because this context will never be reset or deleted." I.e. anything allocated in TopMemoryContext will live until the session ends. See: http://www.joeconway.com/tut_oscon_2004.pdf particularly starting at or about page 64. Much of the detailed explanation is not in the slides, but it should give you some examples and ideas. There are examples throughout the presentation, and several of them have examples of memory context use. Joe
В списке pgsql-novice по дате отправления: