You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Tony Finch <do...@dotat.at> on 2000/12/01 01:10:56 UTC

Re: SDBM 2.0 'namespace protection'

rbb@covalent.net wrote:
> 
>> I don't see any purpose served by losing any of those mods.
>
>The reason for losing those mods, is that pools are the wrong solution, as
>is, I believe APR.  APR would be the correct solution if it wasn't tied to
>pools, but it is.

On the whole the sdbm changes (relative to the sdbm in perl) are
minor, afaics. I can't see that the use of pools is a problem (mostly
because sdbm doesn't do much allocation), except in one case: in
sdbm_open() a malloc() followed almost immediately by a free() was
changed into allocation from a long-lived pool (i.e. a memory leak).

Tony.
-- 
f.a.n.finch     dot@dotat.at     fanf@covalent.net     Chad for President!

Re: SDBM 2.0 'namespace protection'

Posted by Greg Stein <gs...@lyra.org>.
On Fri, Dec 01, 2000 at 12:10:56AM +0000, Tony Finch wrote:
> rbb@covalent.net wrote:
> >> I don't see any purpose served by losing any of those mods.
> >
> >The reason for losing those mods, is that pools are the wrong solution, as
> >is, I believe APR.  APR would be the correct solution if it wasn't tied to
> >pools, but it is.
> 
> On the whole the sdbm changes (relative to the sdbm in perl) are
> minor, afaics. I can't see that the use of pools is a problem (mostly
> because sdbm doesn't do much allocation), except in one case: in
> sdbm_open() a malloc() followed almost immediately by a free() was
> changed into allocation from a long-lived pool (i.e. a memory leak).

"long-lived pool" is making a supposition about that pool. In fact, that
pool could be very short lived :-)

[ and concretely: Joe Orton has patched mod_dav to do just that; that patch
  will be incorporated into Apache 2.0 in some fashion, but there are a few
  things to sort out first. ]

In any case... Tony: update your working copy (I changed that code yesterday
at Ryan's suggestion); the malloc was put back and the memory is freed at
close time or pool cleanup time. The pools are still used for files. (we
also use APR for advisory locks on those files)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/