]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Enable more optimization opportunities.
authorBart Van Assche <bvanassche@acm.org>
Fri, 6 Jun 2008 10:18:24 +0000 (10:18 +0000)
committerBart Van Assche <bvanassche@acm.org>
Fri, 6 Jun 2008 10:18:24 +0000 (10:18 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8195

exp-drd/Makefile.am
exp-drd/drd_main.c
exp-drd/drd_thread.c
exp-drd/drd_thread.h

index ef2441efa5bb804da7a22f2ca8f4a2ffca7ff39f..9f033852e18c9894f5bee7691a45357c5a086613 100644 (file)
@@ -97,11 +97,8 @@ DRD_SOURCES_COMMON =    \
   drd_malloc_wrappers.c \
   drd_mutex.c           \
   drd_rwlock.c          \
-  drd_segment.c         \
   drd_semaphore.c       \
-  drd_suppression.c     \
-  drd_thread.c          \
-  drd_vc.c
+  drd_suppression.c
 
 noinst_HEADERS =        \
   drd_barrier.h         \
index 4fb9010574efb5a818f615321c0555094f69fcf6..c8131897ea3bcf7573c9f85bab8e73717e97d3c9 100644 (file)
 #include "pub_tool_tooliface.h"
 
 
+/* Include several source files here in order to allow the compiler to */
+/* do more inlining.                                                   */
+#include "drd_bitmap.c"
+#include "drd_segment.c"
+#include "drd_thread.c"
+#include "drd_vc.c"
+
+
+
 // Function declarations.
 
 static void drd_start_client_code(const ThreadId tid, const ULong bbs_done);
index a01550854491215bb2fb61eb707e16b289266262..cc15eb9056f7191ebe49a427391b2d617ee7b667 100644 (file)
@@ -39,9 +39,6 @@
 #include "pub_tool_options.h"     // VG_(clo_backtrace_size)
 #include "pub_tool_threadstate.h" // VG_(get_pthread_id)()
 
-/* Include the drd_bitmap.c source file here to allow the compiler to     */
-/* inline the bitmap manipulation functions called from this source file. */
-#include "drd_bitmap.c"
 
 
 // Local functions.
@@ -89,14 +86,6 @@ void thread_set_segment_merging(const Bool m)
   s_segment_merging = m;
 }
 
-__inline__ Bool IsValidDrdThreadId(const DrdThreadId tid)
-{
-  return (0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID
-          && ! (s_threadinfo[tid].vg_thread_exists == False
-                && s_threadinfo[tid].posix_thread_exists == False
-                && s_threadinfo[tid].detached_posix_thread == False));
-}
-
 /**
  * Convert Valgrind's ThreadId into a DrdThreadId. Report failure if
  * Valgrind's ThreadId does not yet exist.
index 7a0bd25002e5dd8493bf8a42c0bcad5a8aa0379d..299bed321064744fd2d9157a72df8ac03b54ac0e 100644 (file)
@@ -92,7 +92,6 @@ extern struct bitmap* s_danger_set;
 void thread_trace_context_switches(const Bool t);
 void thread_trace_danger_set(const Bool t);
 void thread_set_segment_merging(const Bool m);
-Bool IsValidDrdThreadId(const DrdThreadId tid);
 
 DrdThreadId VgThreadIdToDrdThreadId(const ThreadId tid);
 DrdThreadId NewVgThreadIdToDrdThreadId(const ThreadId tid);
@@ -154,6 +153,15 @@ ULong thread_get_danger_set_bitmap_creation_count(void);
 ULong thread_get_danger_set_bitmap2_creation_count(void);
 
 
+static __inline__
+Bool IsValidDrdThreadId(const DrdThreadId tid)
+{
+  return (0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID
+          && ! (s_threadinfo[tid].vg_thread_exists == False
+                && s_threadinfo[tid].posix_thread_exists == False
+                && s_threadinfo[tid].detached_posix_thread == False));
+}
+
 static inline
 DrdThreadId thread_get_running_tid(void)
 {