You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@codematters.co.uk> on 2018/07/30 13:01:06 UTC

authz pool usage

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