Re: Memory-context slinging
От | Peter Eisentraut |
---|---|
Тема | Re: Memory-context slinging |
Дата | |
Msg-id | Pine.LNX.4.21.0007042111030.3542-100000@localhost.localdomain обсуждение исходный текст |
Ответ на | Memory-context slinging (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Memory-context slinging
|
Список | pgsql-hackers |
Tom Lane writes: > If you really truly want a context that's destroyed by elog(ERROR), > and not by any other event, then create it as a child of ErrorContext, > and that's what will happen. But I suspect what you really want is a > context that's a child of TopTransactionContext and will go away at > either transaction commit or transaction abort. No, actually I wanted the former. Notice how the configuration file is first read in completely as a linked list. When something goes wrong (garbage in the file) I need to free the list (and other things) before calling elog. The alternative would be to create a separate memory context for this processing, but that's more of a purity issue, it wouldn't make it work better, AFAICT. > A difficulty I have been noticing with some of these special-purpose > contexts is that you'd like to keep a pointer to them in some global > variable, but there's no easy way to determine whether that pointer is > currently valid Shouldn't it be NULL if it's not valid? -- Peter Eisentraut Sernanders väg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden
В списке pgsql-hackers по дате отправления: