Inlined thread_conflicting_access(). Changed thread_get_danger_set() and thread_get_segment() from extern to inline.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7673 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/exp-drd/drd_thread.h b/exp-drd/drd_thread.h
index 550daaf..5c5aae0 100644
--- a/exp-drd/drd_thread.h
+++ b/exp-drd/drd_thread.h
@@ -56,26 +56,26 @@
typedef struct
{
- Segment* first;
- Segment* last;
- ThreadId vg_threadid;
- PThreadId pt_threadid;
- Addr stack_min_min;
- Addr stack_min;
- Addr stack_startup;
- Addr stack_max;
- char name[32];
- /// Indicates whether the Valgrind core knows about this thread.
- Bool vg_thread_exists;
- /// Indicates whether there is an associated POSIX thread ID.
- Bool posix_thread_exists;
- /// If true, indicates that there is a corresponding POSIX thread ID and
- /// a corresponding OS thread that is detached.
- Bool detached_posix_thread;
- /// Wether recording of memory accesses is active.
- Bool is_recording;
- /// Nesting level of synchronization functions called by the client.
- Int synchr_nesting;
+ Segment* first;
+ Segment* last;
+ ThreadId vg_threadid;
+ PThreadId pt_threadid;
+ Addr stack_min_min;
+ Addr stack_min;
+ Addr stack_startup;
+ Addr stack_max;
+ char name[32];
+ /// Indicates whether the Valgrind core knows about this thread.
+ Bool vg_thread_exists;
+ /// Indicates whether there is an associated POSIX thread ID.
+ Bool posix_thread_exists;
+ /// If true, indicates that there is a corresponding POSIX thread ID and
+ /// a corresponding OS thread that is detached.
+ Bool detached_posix_thread;
+ /// Wether recording of memory accesses is active.
+ Bool is_recording;
+ /// Nesting level of synchronization functions called by the client.
+ Int synchr_nesting;
} ThreadInfo;
@@ -84,6 +84,7 @@
extern DrdThreadId s_drd_running_tid;
extern ThreadInfo s_threadinfo[DRD_N_THREADS];
+extern struct bitmap* s_danger_set;
// Function declarations.
@@ -121,7 +122,6 @@
int thread_enter_synchr(const DrdThreadId tid);
int thread_leave_synchr(const DrdThreadId tid);
int thread_get_synchr_nesting_count(const DrdThreadId tid);
-Segment* thread_get_segment(const DrdThreadId tid);
void thread_new_segment(const DrdThreadId tid);
VectorClock* thread_get_vc(const DrdThreadId tid);
void thread_combine_vc(const DrdThreadId joiner, const DrdThreadId joinee);
@@ -134,9 +134,6 @@
void thread_report_races_segment(const DrdThreadId tid,
const Segment* const p);
void thread_report_all_races(void);
-Bool thread_conflicting_access(Addr const a,
- SizeT const size,
- BmAccessTypeT access_type);
void thread_report_conflicting_segments(const DrdThreadId tid,
const Addr addr,
const SizeT size,
@@ -149,13 +146,29 @@
ULong thread_get_danger_set_bitmap2_creation_count(void);
+static
+inline struct bitmap* thread_get_danger_set(void)
+{
+ return s_danger_set;
+}
+
static inline
Bool running_thread_is_recording(void)
{
- tl_assert(0 <= s_drd_running_tid && s_drd_running_tid < DRD_N_THREADS
- && s_drd_running_tid != DRD_INVALID_THREADID);
- return (s_threadinfo[s_drd_running_tid].synchr_nesting == 0
- && s_threadinfo[s_drd_running_tid].is_recording);
+ tl_assert(0 <= s_drd_running_tid && s_drd_running_tid < DRD_N_THREADS
+ && s_drd_running_tid != DRD_INVALID_THREADID);
+ return (s_threadinfo[s_drd_running_tid].synchr_nesting == 0
+ && s_threadinfo[s_drd_running_tid].is_recording);
+}
+
+/** Return a pointer to the latest segment for the specified thread. */
+static inline
+Segment* thread_get_segment(const DrdThreadId tid)
+{
+ tl_assert(0 <= tid && tid < DRD_N_THREADS
+ && tid != DRD_INVALID_THREADID);
+ tl_assert(s_threadinfo[tid].last);
+ return s_threadinfo[tid].last;
}