PERFORCE change 127224 for review

Fredrik Lindberg fli at FreeBSD.org
Fri Oct 5 04:58:10 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=127224

Change 127224 by fli at fli_genesis on 2007/10/05 11:57:44

	- Add a periodic timer that calls obj_clean().
	- Add a call to obj_destroy() on exit to free memory. 

Affected files ...

.. //depot/projects/soc2007/fli-mdns_sd/mdnsd/mdnsd.c#8 edit

Differences ...

==== //depot/projects/soc2007/fli-mdns_sd/mdnsd/mdnsd.c#8 (text+ko) ====

@@ -153,6 +153,17 @@
 }
 
 /*
+ * Periodic object garabge collector, runs every 60 seconds
+ */
+static int
+evh_objclean(const struct event_tmr *ev __unused, const ev_arg arg __unused)
+{
+
+	obj_clean();
+	return (0);
+}
+
+/*
  * Link state change.
  * This routine is called 3 seconds after the real link state change
  * occured, this is to catch and ignore sporadic link changes.
@@ -957,6 +968,7 @@
 	freeifaddrs(ifap);
 
 	tmr_start(&glob, 1000, evh_cacheclean, &glob, 0);
+	tmr_start(&glob, 60000, evh_objclean, NULL, 0);
 
 	uid = getuid();
 	euid = geteuid();
@@ -1001,6 +1013,7 @@
 	wq_destroy(glob.g_wq);
 	event_destroy(glob.g_evl);
 	mdns_bufpool_destroy(glob.g_bp);
+	obj_destroy();
 
 	return (0);
 }


More information about the p4-projects mailing list