Re: question on how to correctly communicate with external library functions which return malloc()'ed strings - Mailing list pgsql-hackers

From Vladimir Volovich
Subject Re: question on how to correctly communicate with external library functions which return malloc()'ed strings
Date
Msg-id 87tzi82olx.fsf@external.prs-office.com
Whole thread Raw
In response to Re: question on how to correctly communicate with external library functions which return malloc()'ed strings  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: question on how to correctly communicate with external library functions which return malloc()'ed strings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"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
postgresql8.3, the>> "free" is a macro defined in snowball/header.h: #define free(a)>> pfree(a)
 
MvO> It does seem wrong. Do you include that header file explicitly?MvO> Because it shouldn't be necessary.

i needed some prototypes from snowball in the same source file, so i
included snowball/header.h; it appears that it is sufficient to use #include <snowball/libstemmer/api.h>
instead of #include <snowball/header.h>

but please remove the "#define free" from snowball/header.h because, as
you said, it's wrong.

Best,
v.



pgsql-hackers by date:

Previous
From: Decibel!
Date:
Subject: Re: Commit fest queue
Next
From: Oleg Bartunov
Date:
Subject: Re: Index AM change proposals, redux