Revision: 55052
http://brlcad.svn.sourceforge.net/brlcad/?rev=55052&view=rev
Author: brlcad
Date: 2013-04-05 03:48:06 +0000 (Fri, 05 Apr 2013)
Log Message:
-----------
the printing function need not be made public api, tighten the scope. also
make sure it only prints once since it can conceivably get registered multiple
times
Modified Paths:
--------------
brlcad/trunk/src/libbu/heap.c
Modified: brlcad/trunk/src/libbu/heap.c
===================================================================
--- brlcad/trunk/src/libbu/heap.c 2013-04-05 03:41:34 UTC (rev 55051)
+++ brlcad/trunk/src/libbu/heap.c 2013-04-05 03:48:06 UTC (rev 55052)
@@ -100,9 +100,11 @@
static struct cpus per_cpu[MAX_PSW] = {{{{0, 0, 0, 0}}, 0}};
-void
-bu_heap_print()
+static void
+heap_print()
{
+ static int printed = 0;
+
size_t h, i, j;
size_t misses = 0;
size_t allocations = 0;
@@ -110,6 +112,13 @@
size_t total_alloc = 0;
size_t ncpu = bu_avail_cpus();
+ /* this may get registered for atexit() multiple times, so make
+ * sure we only do this once
+ */
+ if (printed++ > 0) {
+ return;
+ }
+
bu_log("=======================\n"
"Memory Heap Information\n"
"-----------------------\n");
@@ -170,7 +179,7 @@
if (bu_debug && printit == 0) {
printit++;
- atexit(bu_heap_print);
+ atexit(heap_print);
}
bin->pages++;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits