Branch: Tag:

2009-11-24

2009-11-24 22:53:24 by Martin Stjernholm <mast@lysator.liu.se>

Added a few auxiliary functions.

Rev: server/base_server/cache.pike:1.116

1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2009, Roxen IS. - // $Id: cache.pike,v 1.115 2009/11/20 14:01:44 mast Exp $ + // $Id: cache.pike,v 1.116 2009/11/24 22:53:24 mast Exp $      #include <roxen.h>   #include <config.h>
288: Inside #if defined(NEW_RAM_CACHE)
   }    }    +  int free_space() +  //! Returns the amount of unused space left. Might be negative in +  //! some narrow time windows when the cache is over its limit and +  //! @[evict] hasn't yet catched up. +  { +  return size_limit - size; +  } +     string format_cost (int|float cost) {return "-";}    //! Function to format a cost measurement for display in the status    //! page.
919: Inside #if defined(NEW_RAM_CACHE)
   }   }    + CacheManager cache_get_manager (string cache_name) + //! Returns the cache manager for the given cache, or zero if the + //! cache isn't registered. + { +  return caches[cache_name]; + } +    void cache_change_manager (string cache_name, CacheManager manager)   //! Changes the manager for a cache. All the cache entries are moved   //! to the new manager, but it might not have adequate information to