apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luke Kenneth Casson Leighton <l...@samba-tng.org>
Subject Re: apr_memory_system.c;apr_memory_system.h
Date Mon, 07 May 2001 15:45:21 GMT
On Sun, May 06, 2001 at 04:59:02PM -0700, rbb@covalent.net wrote:
> 
> > > This is the stackable memory that the Samba TNG guys put together.  This
> > > is very impressive IMHO.  I believe this is the way to move forward with
> > > APR's memory requirements.  I would like to commit this to APR to get
> > > people hacking on this.  To that end, unless somebody objects, I will
> > > commit this on Monday morning.  Once it is committed, I expect people can
> > > use this to re-implement pools (same semantics, same API, just different
> > > under the covers), and shared memory.
> >
> > I don't know if you are implying this, but in the long run the apr_pool_t
> > as it is present now in the code should be replaced by apr_memory_system_t.
> > This way you can plug in different memory systems in certain locations.
> > The pool memory system is just one of them.

recommend doing this in stages, where you can stop at any time :)

1) implement apr_pool in terms of sms.  sms, to people familiar with
apr_pool, will also be familiar with sms, btw :)

1a) apr_pool's apr_pool_initialise() should call an apr_pool_memsys_init()
which has one extra argument - the parent memsys from which the
apr_pool_t should obtain any memory it requires to create itself and
any child pools etc, etc.

2) optional deprecation of apr_pool_initialise()

3) optional deprecation of apr_pool_memsys_init()

4) optional deprecation of apr_pool altogether, although... i wouldn't
recommend this, myself.  the apr_pool api is a convenient hider-of-memory
and is pretty well established.

the ultimate intent would be to use it (apr pool api) to hide the fact
that the parent memory it allocates from is shared memory, kernel pages,
swap-locked, mmapped, files-on-disk, carrier pigeons, etc.

memsys is low-level: apr pool api is convenience.

luke


Mime
View raw message