|
From: <sv...@va...> - 2014-10-22 09:44:41
|
Author: florian
Date: Wed Oct 22 10:44:34 2014
New Revision: 14650
Log:
Change the initialisation of the newly allocated struct sched_lock
object. Just memset the whole thing to 0. That avoids a cast that
drops type qualifiction.
Modified:
trunk/coregrind/m_scheduler/ticket-lock-linux.c
Modified: trunk/coregrind/m_scheduler/ticket-lock-linux.c
==============================================================================
--- trunk/coregrind/m_scheduler/ticket-lock-linux.c (original)
+++ trunk/coregrind/m_scheduler/ticket-lock-linux.c Wed Oct 22 10:44:34 2014
@@ -82,10 +82,7 @@
// The futex syscall requires that a futex takes four bytes.
vg_assert(sizeof(p->futex[0]) == 4);
- p->head = 0;
- p->tail = 0;
- VG_(memset)((void*)p->futex, 0, sizeof(p->futex));
- p->owner = 0;
+ VG_(memset)(p, 0, sizeof(*p));
INNER_REQUEST(ANNOTATE_RWLOCK_CREATE(p));
INNER_REQUEST(ANNOTATE_BENIGN_RACE_SIZED(&p->futex, sizeof(p->futex), ""));
|