httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@ai.mit.edu (Robert S. Thau)
Subject Re: Broken clients
Date Tue, 23 Jul 1996 16:14:15 GMT
  I wouldn't do this.  1) Henry's stuff has already been tested to not
  leak memory, and 2) the regex package uses free's which are not directly
  supported by the pool allocation.

Agreed.  The most plausible reason to tie compiled regexes (regcomp
results) is to avoid leaks on the part of the *callers* of the regex
package --- in particular, to have something automatically take care
of calling regfree(), so you don't have to manually stick a regree
into every execution path.

However, the path of least resistance for accomplishing that is
register_cleanup, which allows you to declare a function to be called
(with a given void* argument) when the pool is cleared or destroyed.
Given that machinery, a pregcomp could be written in about fifteen
lines of code (it would look a lot like pfopen() and its support code,
in fact).

rst

Mime
View raw message