Subject Re: [firebird-support] UDF memory allocation for result string in Linux
Author Tomasz Tyrakowski
On 2012-04-17 08:01, ma_golyo wrote:

> I use ib_util_malloc in my Win version, no problem there. What should I use in Linux version? Currently memory allocated with malloc.

Include ib_util.h in your UDF's source (it's located by default in
/opt/firebird/include) or explicitly declare void*
ib_util_malloc(size_t) at the beginning of the source module, use
ib_util_malloc instead of C's malloc, and link against ib_util
( is by default located in /opt/firebird/lib).
Your compilation command line should look like this:

gcc -O -fPIC -shared -I/opt/firebird/include -L/opt/firebird/lib \ UDF3s.c -lib_util -lstdc++ -lm -lc

(I'm not sure whether libstdc++ is necessary, sometimes it is).


__--== Tomasz Tyrakowski ==--__
__--== SOL-SYSTEM ==--__
__--== ==--__