Re: question on how to correctly communicate with external library functions which return malloc()'ed strings
| От | Martijn van Oosterhout |
|---|---|
| Тема | Re: question on how to correctly communicate with external library functions which return malloc()'ed strings |
| Дата | |
| Msg-id | 20080411094845.GC23648@svana.org обсуждение исходный текст |
| Ответ на | question on how to correctly communicate with external library functions which return malloc()'ed strings (Vladimir Volovich <vvv@vsu.ru>) |
| Ответы |
Re: question on how to correctly communicate with external library functions which return malloc()'ed strings
|
| Список | pgsql-hackers |
On Thu, Apr 10, 2008 at 07:28:29PM -0700, Vladimir Volovich wrote: > it worked fine with postgresql 8.2; with 8.3 it started segfaulting, and > it appeared that the reason is because in postgresql 8.3, the "free" is > a macro defined in > snowball/header.h: > #define free(a) pfree(a) It does seem wrong. Do you include that header file explicitly? Because it shouldn't be necessary. > #ifdef free > #warning undefining free > #undef free > #endif > #include <stdlib.h> > > but i want to ask you, postgresql hackers, on how we are supposed to > work with external library functions which return malloc()'ed strings? See if you can avoid including that header altogether... 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 по дате отправления: