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"
// 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;
/**
* Note: creator and created may be equal.
*/
+static
void sg_init(Segment* const sg,
DrdThreadId const creator,
DrdThreadId const created)
}
}
+static
void sg_cleanup(Segment* const sg)
{
tl_assert(sg);
{
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);
}
#endif
- s_segments_alive_count--;
+ s_alive_segments_count--;
tl_assert(sg);
sg_cleanup(sg);
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;
}
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