]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Renamed functions for querying segment creation counters. Added the function sg_get_a...
authorBart Van Assche <bvanassche@acm.org>
Mon, 17 Mar 2008 17:37:53 +0000 (17:37 +0000)
committerBart Van Assche <bvanassche@acm.org>
Mon, 17 Mar 2008 17:37:53 +0000 (17:37 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7726

exp-drd/drd_main.c
exp-drd/drd_segment.c
exp-drd/drd_segment.h

index 6033dc468eaf08c38641c2e41157722f3bf6d430..bec8d81a3ebaf72f773ab0a133e75b6294309d03 100644 (file)
@@ -967,8 +967,8 @@ void drd_fini(Int exitcode)
                  thread_get_update_danger_set_count());
     VG_(message)(Vg_DebugMsg,
                  " segments: %lld total, %lld max, %lld discard points",
-                 sg_get_segments_created_count(),
-                 sg_get_max_segments_alive_count(),
+                 sg_get_created_segments_count(),
+                 sg_get_max_alive_segments_count(),
                  thread_get_discard_ordered_segments_count());
     VG_(message)(Vg_DebugMsg,
                  "  bitmaps: %lld / %lld bitmaps were allocated"
index 6cf4f8df778b887e029808d37df7572a564b0547..12695634640174498b3121af07deda616bd09560 100644 (file)
@@ -38,9 +38,9 @@
 
 // Local variables.
 
-static ULong s_segments_created_count;
-static ULong s_segments_alive_count;
-static ULong s_max_segments_alive_count;
+static ULong s_created_segments_count;
+static ULong s_alive_segments_count;
+static ULong s_max_alive_segments_count;
 static Bool drd_trace_segment = False;
 
 
@@ -49,6 +49,7 @@ static Bool drd_trace_segment = False;
 /**
  * Note: creator and created may be equal.
  */
+static
 void sg_init(Segment* const sg,
              DrdThreadId const creator,
              DrdThreadId const created)
@@ -89,6 +90,7 @@ void sg_init(Segment* const sg,
   }
 }
 
+static
 void sg_cleanup(Segment* const sg)
 {
   tl_assert(sg);
@@ -101,10 +103,10 @@ Segment* sg_new(ThreadId const creator, ThreadId const created)
 {
   Segment* sg;
 
-  s_segments_created_count++;
-  s_segments_alive_count++;
-  if (s_max_segments_alive_count < s_segments_alive_count)
-    s_max_segments_alive_count = s_segments_alive_count;
+  s_created_segments_count++;
+  s_alive_segments_count++;
+  if (s_max_alive_segments_count < s_alive_segments_count)
+    s_max_alive_segments_count = s_alive_segments_count;
 
   sg = VG_(malloc)(sizeof(*sg));
   tl_assert(sg);
@@ -126,7 +128,7 @@ void sg_delete(Segment* const sg)
   }
 #endif
 
-  s_segments_alive_count--;
+  s_alive_segments_count--;
 
   tl_assert(sg);
   sg_cleanup(sg);
@@ -153,12 +155,17 @@ void sg_set_trace(Bool const trace_segment)
   drd_trace_segment = trace_segment;
 }
 
-ULong sg_get_segments_created_count(void)
+ULong sg_get_created_segments_count(void)
 {
-  return s_segments_created_count;
+  return s_created_segments_count;
 }
 
-ULong sg_get_max_segments_alive_count(void)
+ULong sg_get_alive_segments_count(void)
 {
-  return s_max_segments_alive_count;
+  return s_alive_segments_count;
+}
+
+ULong sg_get_max_alive_segments_count(void)
+{
+  return s_max_alive_segments_count;
 }
index e249bef97caf482ad3926698f331b3e6bc20b7f4..ae7141bf5eaa43f3c4c19b2f625021720f879026 100644 (file)
@@ -47,17 +47,14 @@ typedef struct segment
   struct bitmap*     bm;
 } Segment;
 
-void sg_init(Segment* const sg,
-             const ThreadId creator,
-             const ThreadId created);
-void sg_cleanup(Segment* const sg);
 Segment* sg_new(const ThreadId creator, const ThreadId created);
 void sg_delete(Segment* const sg);
 void sg_print(const Segment* const sg);
 Bool sg_get_trace(void);
 void sg_set_trace(const Bool trace_segment);
-ULong sg_get_segments_created_count(void);
-ULong sg_get_max_segments_alive_count(void);
+ULong sg_get_created_segments_count(void);
+ULong sg_get_alive_segments_count(void);
+ULong sg_get_max_alive_segments_count(void);
 
 
 #endif // __SEGMENT_H