apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: [PATCH] Re: mmap_setaside?
Date Wed, 14 Nov 2001 16:30:01 GMT
On Tue, 13 Nov 2001, Brian Pane wrote:

> Thanks for the pointer.  Here's my attempt to work around the problem
> that you noted in that message--the fact that the apr_mmap_t cleanup
> function isn't accessible from within mmap_setaside.  My solution was
> to add a pointer to the cleanup function as an extra field in the
> apr_mmap_t.

Why a function pointer instead of just exposing mmap_cleanup as a public
function?  You're essentially making it public anyway through the function
pointer, and we don't really need polymorphism since there's only one
mmap_cleanup function for a given APR platform...

> In this patch, I've only tried to optimize for the case where the
> destination pool is an ancestor of the current pool.  For disjoint
> pools, it will still do the big memcpy.

That's fine.  It's definitely better than what we have now.  I still
haven't found a case where you'd _want_ to setaside into a disjoint pool.
But somebody felt we should leave the option open.  <shrug>

One thing, though, shouldn't we be copying to the heap instead of to the
pool?  That way we can at least free() the thing when we're done with
it rather than growing the pools to be really huge forever...

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA




Mime
View raw message