[cairo-commit] cairo/src cairo-cache.c, 1.11, 1.12 cairoint.h, 1.147, 1.148

Carl Worth commit at pdx.freedesktop.org
Fri Jun 3 16:22:29 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv10308/src

Modified Files:
	cairo-cache.c cairoint.h 
Log Message:

        * src/cairoint.h:
        * src/cairo-cache.c: (_cairo_cache_init), (_cairo_cache_destroy):
        Remove unused cache->refcount and _cairo_cache_reference().

        * src/cairo-cache.c: (_cairo_cache_destroy): Remove gratuitous
        nesting as recommended in CODING_STYLE.


Index: cairo-cache.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-cache.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- cairo-cache.c	3 Jun 2005 21:51:57 -0000	1.11
+++ cairo-cache.c	3 Jun 2005 23:22:27 -0000	1.12
@@ -345,7 +345,6 @@
 
     if (cache != NULL){
 	cache->arrangement = &cache_arrangements[0];
-	cache->refcount = 1;
 	cache->max_memory = max_memory;
 	cache->used_memory = 0;
 	cache->live_entries = 0;
@@ -368,31 +367,20 @@
 }
 
 void
-_cairo_cache_reference (cairo_cache_t *cache)
-{
-    _cache_sane_state (cache);
-    cache->refcount++;
-}
-
-void
 _cairo_cache_destroy (cairo_cache_t *cache)
 {
     unsigned long i;
-    if (cache != NULL) {
+    if (cache == NULL)
+	return;
 	
-	_cache_sane_state (cache);
+    _cache_sane_state (cache);
 
-	if (--cache->refcount > 0)
-	    return;
-	
-	for (i = 0; i < cache->arrangement->size; ++i) {
-	    _entry_destroy (cache, i);
-	}
+    for (i = 0; i < cache->arrangement->size; ++i)
+	_entry_destroy (cache, i);
 	
-	free (cache->entries);
-	cache->entries = NULL;
-	cache->backend->destroy_cache (cache);
-    }
+    free (cache->entries);
+    cache->entries = NULL;
+    cache->backend->destroy_cache (cache);
 }
 
 cairo_status_t

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -d -r1.147 -r1.148
--- cairoint.h	3 Jun 2005 23:16:44 -0000	1.147
+++ cairoint.h	3 Jun 2005 23:22:27 -0000	1.148
@@ -356,7 +356,6 @@
 #undef CAIRO_MEASURE_CACHE_PERFORMANCE
 
 typedef struct {
-    unsigned long refcount;
     const cairo_cache_backend_t *backend;
     const cairo_cache_arrangement_t *arrangement;
     cairo_cache_entry_base_t **entries;




More information about the cairo-commit mailing list