Hi, I have interesting question that stops me now. Suppose I have 2 functions 1. preparestate 2. doajob first allocates some state using MemoryContextAlloc(TopTransactionContext) or something, another function using that memory. question is how I lookup that memory in second function doajob? Of cause I can return a handle from first function, pointer and accept that pointer in second function, but in this case I have to check that pointer on validity and so on... Is there any good practice ( some way to do so ) for that? Thank you.
Maksim Likharev wrote: > Of cause I can return a handle from first function, pointer and accept > that pointer in second function, but in this case I have to check > that pointer on validity and so on... > > Is there any good practice ( some way to do so ) for that? > Best way I've come up with to do this is by using a hash table based on a name lookup. See the way it's done in dblink now (as of a week or so ago) for named persistent connections. HTH, Joe
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера