Re: [HACKERS] question on how to correctly communicate with external library functions which return malloc()'ed strings

2008-04-11 Thread Vladimir Volovich
"TL" == Tom Lane writes: TL> It's not wrong and it won't be removed. Please note the header TL> comment in that file: TL> * NOTE: this file should not be included into any non-snowball TL> sources! ok, i'll just include snowball/libstemmer/api.h or snowball/libstemmer/header.h instead. i

Re: [HACKERS] question on how to correctly communicate with external library functions which return malloc()'ed strings

2008-04-11 Thread Vladimir Volovich
"MvO" == Martijn van Oosterhout writes: >> 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) MvO> It does seem wrong. Do you

[HACKERS] question on how to correctly communicate with external library functions which return malloc()'ed strings

2008-04-11 Thread Vladimir Volovich
Hi! i'm using a module for postgresql (8.2 and 8.3) which links with a 3rd-party library and calls a function from there which returns a malloc()'ed string. [it's a libunac, and unac_string() but the question is general] there was a pg_unac-8.2.tar.gz tarball distributed on the net, which has th