Re: ESQL/C memory leak while working with LVARCHAR data (on Win32)
Posted in 2004
These functions in such sequence are used to pass lvarchar parameter in SQL (see ESQL/C reference, part where work with lvarchar type is described). But I also detect that troubles have place when lvarchar data is fetched. Memory profiler reports 16 bytes memory leak on each ifx_var_flag call. "hobbes" <pasdespam@yahoo.fr> wrote in message news:<403ef7d3$0$24939$626a14ce@news.free.fr>... > Just for information... > > I just compile and launch > > and : it works the same for me .... > It grows ..... > > > I can't find any doc on the functions.... > So i do not even know what it does > > Windows with : CSDK 2.81TC2 > > > "Sergey V. Buturlakin" <fisher@softline.kiev.ua> a 'crit dans le message de > news:fa109156.0402261200.5a6e4796@posting.google.com... > > While working with lvarchar data on win32 platform I'd trap on serious > > memory leak when such data is deallocated. Here is simple ESQL/C > > program: > > > > #include <stdio.h> > > > > int main() > > { > > EXEC SQL BEGIN DECLARE SECTION; > > lvarchar *_value; > > EXEC SQL END DECLARE SECTION; > > char testdata[100]; > > int i; > > > > for (i = 0; i < 10000000; i++) > > { > > _value = 0; > > ifx_var_flag(&_value, 0); > > ifx_var_alloc(&_value, 101); > > ifx_var_setlen(&_value, 100); > > ifx_var_setdata(&_value, testdata, 100); > > ifx_var_init(&_value); > > ifx_var_dealloc(&_value); > > } > > > > getchar(); > > }