subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Martin <phi...@codematters.co.uk>
Subject authz pool usage
Date Mon, 30 Jul 2018 13:01:06 GMT
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

Mime
View raw message