This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[intercu] Fix cache aging


Two things I noticed while timing the various cache age settings.  First of
all, I was double-aging the cache.  Secondly, I documented 0 as disabling
the cache - but var_uinteger sets the associated variable to UINT_MAX, not
zero, when the user types a zero.  I wanted var_zinteger.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-04-19  Daniel Jacobowitz  <drow@mvista.com>

	* dwarf2read.c (free_comp_units_worker): Remove incorrect aging.
	(_initialize_dwarf2_read): Use var_zinteger.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.135.2.42
diff -u -p -r1.135.2.42 dwarf2read.c
--- dwarf2read.c	19 Apr 2004 20:35:19 -0000	1.135.2.42
+++ dwarf2read.c	19 Apr 2004 22:35:16 -0000
@@ -9177,10 +9177,7 @@ free_comp_units_worker (struct dwarf2_cu
 	  *last_chain = next_cu;
 	}
       else
-	{
-	  per_cu->cu->last_used++;
-	  last_chain = &per_cu->cu->read_in_chain;
-	}
+	last_chain = &per_cu->cu->read_in_chain;
 
       per_cu = next_cu;
     }
@@ -9453,17 +9450,17 @@ _initialize_dwarf2_read (void)
                   &show_dwarf2_cmdlist, "maintenance show dwarf2 ",
                   0/*allow-unknown*/, &maintenance_show_cmdlist);
 
-  add_setshow_uinteger_cmd ("max-cache-age", class_obscure,
-                            &dwarf2_max_cache_age,
-			    "Set an upper bound on the age of cached "
-			    "compilation units.\n"
-			    "A higher limit means that cached "
-			    "compilation units will be stored\n"
-			    "in memory longer, and more total memory will "
-			    "be used.  Zero disables\n"
-			    "caching, which can slow down startup.",
-			    "Show the upper bound on the age of cached "
-			    "dwarf2 compilation units.",
-                            NULL, NULL, &set_dwarf2_cmdlist,
-                            &show_dwarf2_cmdlist);
+  add_setshow_cmd ("max-cache-age", class_obscure, var_zinteger,
+		   &dwarf2_max_cache_age,
+		   "Set an upper bound on the age of cached "
+		   "compilation units.\n"
+		   "A higher limit means that cached "
+		   "compilation units will be stored\n"
+		   "in memory longer, and more total memory will "
+		   "be used.  Zero disables\n"
+		   "caching, which can slow down startup.",
+		   "Show the upper bound on the age of cached "
+		   "dwarf2 compilation units.",
+		   NULL, NULL, &set_dwarf2_cmdlist,
+		   &show_dwarf2_cmdlist);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]