[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

authz pool usage

From: Philip Martin <philip_at_codematters.co.uk>
Date: Mon, 30 Jul 2018 14:01:06 +0100

One thing I noticed in the new authz code is:

typedef struct ctor_baton_t
{
  ...
  /* The parser's scratch pool. This may not be the same pool as
     passed to the constructor callbacks, that is supposed to be an
     iteration pool maintained by the generic parser.

     N.B.: The result pool is AUTHZ->pool. */
  apr_pool_t *parser_pool;
} ctor_baton_t;

static ctor_baton_t *
create_ctor_baton(apr_pool_t *result_pool,
                  apr_pool_t *scratch_pool)
{
  apr_pool_t *const parser_pool = svn_pool_create(scratch_pool);
  ctor_baton_t *const cb = apr_pcalloc(parser_pool, sizeof(*cb));
  ...
  return cb;
}

This is explicitly described as a legacy pattern in our pool guidelines:
https://subversion.apache.org/docs/community-guide/conventions.html#apr-pools

-- 
Philip
Received on 2018-07-30 15:01:23 CEST

This is an archived mail posted to the Subversion Dev mailing list.