apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <...@covalent.net>
Subject Re: cvs commit: apr-util/buckets apr_buckets_mmap.c
Date Tue, 26 Jun 2001 19:19:55 GMT

> > I came up with these questions after sending this suggestion:
> >
> > Where would the reference count go?
> >   - Instead of having an MMAP/file handle, the apr_*_t would have to
> > point to a structure containing the MMAP/file handle, and a reference
> > count.  This memory for this structure could not come from any pool
> > with a shorter lifetime than the server itself.  It would likely have
> > to be directly apr_malloc'ed.
>
> That's a good question... it very well might have to be malloc'ed and then
> free'd when the last reference gets deleted, much as the bucket destroy
> functions have to do with the apr_bucket_shared_delete() stuff.

No.  You can't allocate the MMAP out of malloc.  One of the goals of
pools is that they allow us to call malloc as little as possible.  The
MMAP should just get a copy of the filename, and this problem goes away.

You need to separate MMAPs from buckets.  Buckets are one place MMAPs are
used, but they are used in other places.

Ryan

_____________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
Covalent Technologies			rbb@covalent.net
-----------------------------------------------------------------------------


Mime
View raw message