SIMPLE_RETURN(
(UInt)VG_(client_memalign) ( tst, arg[1], arg[2] )
);
+
+ /* These are heavily used. */
+ case VG_USERREQ__PTHREAD_GET_THREADID:
+ SIMPLE_RETURN(tid);
+ case VG_USERREQ__RUNNING_ON_VALGRIND:
+ SIMPLE_RETURN(1);
+
default:
/* Too hard; wimp out. */
return False;
do_pthread_join( tid, arg[1], (void**)(arg[2]) );
break;
- /* Sigh ... this probably will cause huge numbers of major
- (expensive) scheduling events, for no real reason.
- Perhaps should be classified as a trivial-request. */
- case VG_USERREQ__PTHREAD_GET_THREADID:
- vg_threads[tid].m_edx = tid;
- break;
-
case VG_USERREQ__PTHREAD_MUTEX_INIT:
do_pthread_mutex_init( tid,
(pthread_mutex_t *)(arg[1]),
vg_add_client_stack_block ( tst, arg[1], arg[2] );
return 0;
+ /* Is handled by the scheduler as a trivial request, for
+ performance reasons. */
+ /*
case VG_USERREQ__RUNNING_ON_VALGRIND:
return 1;
+ */
case VG_USERREQ__DO_LEAK_CHECK:
if (!VG_(clo_instrument))
SIMPLE_RETURN(
(UInt)VG_(client_memalign) ( tst, arg[1], arg[2] )
);
+
+ /* These are heavily used. */
+ case VG_USERREQ__PTHREAD_GET_THREADID:
+ SIMPLE_RETURN(tid);
+ case VG_USERREQ__RUNNING_ON_VALGRIND:
+ SIMPLE_RETURN(1);
+
default:
/* Too hard; wimp out. */
return False;
do_pthread_join( tid, arg[1], (void**)(arg[2]) );
break;
- /* Sigh ... this probably will cause huge numbers of major
- (expensive) scheduling events, for no real reason.
- Perhaps should be classified as a trivial-request. */
- case VG_USERREQ__PTHREAD_GET_THREADID:
- vg_threads[tid].m_edx = tid;
- break;
-
case VG_USERREQ__PTHREAD_MUTEX_INIT:
do_pthread_mutex_init( tid,
(pthread_mutex_t *)(arg[1]),