Not sure who owns GNU regex (it seems to be be deprecated, e.g. no
documentation in glibc, but maintained), but I thought the folks here
among the most likely to have a sensible answer to this question:

How should I free the memory allocated by re_compile? regfree seems to
work fine, but it's odd to use a POSIX compatibility API when I'm
otherwise using the GNU API (and I am doing that because I'm using GNU
regex in GNU Zile, which, being an Emacs clone, needs Emacs regex
syntax).

So, is it OK to use regfree? If so, should this be documented in
regex.h? If not, is there some other thing I should be doing, and
should it instead be documented? If I don't call regfree on an
re_pattern before deallocating it, valgrind detects a memory leak.

-- 
http://rrt.sc3d.org

Reply via email to