I have found one leak, which was a typical bug and hard to
detect: thank you Valgrind!

the bug amounts to:

        char *cfunc () { return malloc(N); }
        string cppfunc () { return cfunc(); }

which of course leaks the C string.

The first case valgrind showed was in strftime_helper which
did exactly the above. The enemy here is the C++ string
constructor that takes a char* argument (and doesn't have
an "explicit" annotation).

I'm sure there are more of these :)

A related bug fixed long ago is the Felix cstr() method of strings
which used to fetch the internal C string of a C++ string. Now it
copies that char array to a varray, which is expensive, but the
result is managed by the GC.

Anyhow, strftime bug leaks a small amount of memory on
EVERY http response. 

--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to