You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by cl...@apache.org on 2004/01/06 22:57:50 UTC

cvs commit: httpd-2.0/modules/experimental mod_mem_cache.c

clar        2004/01/06 13:57:50

  Modified:    modules/experimental mod_mem_cache.c
  Log:
  removed deprecated fields cache_size and object_cnt in mem_cache_conf struct
  
  Revision  Changes    Path
  1.102     +0 -16     httpd-2.0/modules/experimental/mod_mem_cache.c
  
  Index: mod_mem_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_mem_cache.c,v
  retrieving revision 1.101
  retrieving revision 1.102
  diff -u -r1.101 -r1.102
  --- mod_mem_cache.c	1 Jan 2004 13:26:18 -0000	1.101
  +++ mod_mem_cache.c	6 Jan 2004 21:57:50 -0000	1.102
  @@ -113,8 +113,6 @@
   typedef struct {
       apr_thread_mutex_t *lock;
       cache_cache_t *cache_cache;
  -    apr_size_t cache_size;
  -    apr_size_t object_cnt;
   
       /* Fields set by config directives */
       apr_size_t min_cache_object_size;   /* in bytes */
  @@ -348,8 +346,6 @@
            */
           if (!obj->cleanup) {
               cache_remove(sconf->cache_cache, obj);
  -            sconf->object_cnt--;
  -            sconf->cache_size -= mobj->m_len;
               obj->cleanup = 1;
           }
           if (sconf->lock) {
  @@ -432,10 +428,8 @@
       sconf->max_cache_object_size = DEFAULT_MAX_CACHE_OBJECT_SIZE;
       /* Number of objects in the cache */
       sconf->max_object_cnt = DEFAULT_MAX_OBJECT_CNT;
  -    sconf->object_cnt = 0;
       /* Size of the cache in bytes */
       sconf->max_cache_size = DEFAULT_MAX_CACHE_SIZE;
  -    sconf->cache_size = 0;
       sconf->cache_cache = NULL;
       sconf->cache_remove_algorithm = memcache_gdsf_algorithm;
       sconf->max_streaming_buffer_size = DEFAULT_MAX_STREAMING_BUFFER_SIZE;
  @@ -550,9 +544,6 @@
   
       if (!tmp_obj) {
           cache_insert(sconf->cache_cache, obj);     
  -        sconf->object_cnt++;
  -        /* Safe cast: Must fit in cache_size or alloc would have failed */
  -        sconf->cache_size += (apr_size_t)len;
       }
       if (sconf->lock) {
           apr_thread_mutex_unlock(sconf->lock);
  @@ -657,8 +648,6 @@
       if (!obj->cleanup) {
           mem_cache_object_t *mobj = (mem_cache_object_t *) obj->vobj;
           cache_remove(sconf->cache_cache, obj);
  -        sconf->object_cnt--;
  -        sconf->cache_size -= mobj->m_len;
           obj->cleanup = 1;
           ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL, "gcing a cache entry");
       }
  @@ -753,8 +742,6 @@
           mem_cache_object_t *mobj;
           cache_remove(sconf->cache_cache, obj);
           mobj = (mem_cache_object_t *) obj->vobj;
  -        sconf->object_cnt--;
  -        sconf->cache_size -= mobj->m_len;
   
   #ifdef USE_ATOMICS
           /* Refcount increment in this case MUST be made under 
  @@ -1053,8 +1040,6 @@
                         (cache_object_t *) cache_find(sconf->cache_cache, obj->key);
                       if (tmp_obj) {
                           cache_remove(sconf->cache_cache, tmp_obj);
  -                        sconf->object_cnt--;
  -                        sconf->cache_size -= mobj->m_len;
                           tmp_obj->cleanup = 1;
                           if (!tmp_obj->refcount) {
                               cleanup_cache_object(tmp_obj);
  @@ -1067,7 +1052,6 @@
                   }
                   mobj->m_len = obj->count;
                   cache_insert(sconf->cache_cache, obj);                
  -                sconf->cache_size -= (mobj->m_len - obj->count);
                   if (sconf->lock) {
                       apr_thread_mutex_unlock(sconf->lock);
                   }