Branch: Tag:

2017-02-28

2017-02-28 12:55:35 by 0

Update cache_register() to accept new prefs object for existing caches. Use
the new setting to avoid warning in RXML <cache> eval.

1638:   //! string that specifies a type of manager (see   //! @[cache_manager_prefs]), or zero to select the default manager.   //! + //! If @[prefs] is given it should point to an instance of + //! @[CacheManagerPrefs] that defines various cache behavior. + //!   //! If the cache already exists, its current manager is simply - //! returned, and @[manager] has no effect. + //! returned, and @[manager] has no effect. It is however possible to + //! update @[prefs] for existing caches.   //!   //! Registering a cache is not mandatory before it is used - one will   //! be created automatically with the default manager otherwise.
1650:    Thread.MutexKey lock =    cache_mgmt_mutex->lock (2); // Called from cache_change_manager too.    -  if (CacheManager mgr = caches[cache_name]) +  if (CacheManager mgr = caches[cache_name]) { +  if (prefs) +  mgr->prefs[cache_name] = prefs;    return mgr; -  +  }       if (!manager) manager = cache_manager_prefs->default;    else if (stringp (manager)) {