示例#1
0
        /// <summary>
        /// Modify the configuration of the window cache.
        /// <para />
        /// The new configuration is applied immediately. If the new limits are
        /// smaller than what what is currently cached, older entries will be purged
        /// as soon as possible to allow the cache to meet the new limit.
        /// </summary>
        /// <param name="cfg">
        /// The new window cache configuration.
        /// </param>
        public static void reconfigure(WindowCacheConfig cfg)
        {
            var         newCache = new WindowCache(cfg);
            WindowCache oldCache = _cache;

            if (oldCache != null)
            {
                oldCache.removeAll();
            }

            _cache = newCache;

            UnpackedObjectCache.Reconfigure(cfg);
        }
示例#2
0
        /// <summary>
        /// Close the resources utilized by this repository.
        /// </summary>
        public void Close()
        {
            UnpackedObjectCache.purge(this);
            WindowCache.Purge(this);

            lock (locker)
            {
                _loadedIdx  = null;
                _reverseIdx = null;
            }

#if DEBUG
            GC.SuppressFinalize(this); // Disarm lock-release checker
#endif
        }
示例#3
0
 public void saveCache(long position, byte[] data, int type)
 {
     UnpackedObjectCache.store(this, position, data, type);
 }
示例#4
0
 public UnpackedObjectCache.Entry readCache(long position)
 {
     return(UnpackedObjectCache.get(this, position));
 }