FreeBSD/contrib/subversion/subversion/libsvn_fs_fs/caching.c
/* This function sets / registers the required callbacks for a given
 * transaction-specific *CACHE object in FS, if CACHE is not NULL and
 * a no-op otherwise. In particular, it will ensure that *CACHE gets
 * reset to NULL upon POOL or FS->POOL destruction latest.
 */
This function sets / registers the required callbacks for a given
transaction-specific *CACHE object in FS, if CACHE is not NULL and
a no-op otherwise. In particular, it will ensure that *CACHE gets
reset to NULL upon POOL or FS->POOL destruction latest.
This function sets / registers the required callbacks for a given transaction - specific * CACHE object in FS if CACHE is not NULL and a no - op otherwise . In particular it will ensure that * CACHE gets reset to NULL upon POOL or FS - > POOL destruction latest .
static void
init_txn_callbacks(svn_fs_t *fs,
                   svn_cache__t **cache,
                   apr_pool_t *pool)
{
  if (*cache != NULL)
    {
      struct txn_cleanup_baton_t *baton;
      baton = apr_palloc(pool, sizeof(*baton));
      baton->txn_cache = *cache;
      baton->to_reset = cache;
      baton->txn_pool = pool;
      baton->fs_pool = fs->pool;
      apr_pool_cleanup_register(pool,
                                baton,
                                remove_txn_cache_txn,
                                apr_pool_cleanup_null);
      apr_pool_cleanup_register(fs->pool,
                                baton,
                                remove_txn_cache_fs,
                                apr_pool_cleanup_null);
    }
}
static void init_txn_callbacks ( svn_fs_t * fs , svn_cache__t * * cache , apr_pool_t * pool ) { if ( * cache != NULL ) { struct txn_cleanup_baton_t * baton ; baton = apr_palloc ( pool , sizeof ( * baton ) ) ; baton -> txn_cache = * cache ; baton -> to_reset = cache ; baton -> txn_pool = pool ; baton -> fs_pool = fs -> pool ; apr_pool_cleanup_register ( pool , baton , remove_txn_cache_txn , apr_pool_cleanup_null ) ; apr_pool_cleanup_register ( fs -> pool , baton , remove_txn_cache_fs , apr_pool_cleanup_null ) ; } }
This function sets / registers the required callbacks for a given
 transaction-specific *CACHE object in FS, if CACHE is not NULL and
 a no-op otherwise.
This function sets / registers the required callbacks for a given transaction - specific * CACHE object in FS if CACHE is not NULL and a no - op otherwise .
/* If any of these pools gets cleaned, we must reset the cache.
       * We don't know which one will get cleaned up first, so register
       * cleanup actions for both and during the cleanup action, unregister
       * the respective other action. */