Skip to content

Commit

Permalink
Follow-up to #2950: do not include valgrind.h on Windows
Browse files Browse the repository at this point in the history
Change-Id: I992c6d66e1b6acb2c1836bbe9e5f21a04dfff8f9
  • Loading branch information
stwhite91 committed Aug 30, 2017
1 parent 59b4dc3 commit 8ecbc84
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/conv-core/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@
#include "conv-trace.h"
#include <sys/types.h>

#ifndef _WIN32
#include "valgrind.h"
#endif

#ifndef CMK_STACKSIZE_DEFAULT
#define CMK_STACKSIZE_DEFAULT 32768
Expand Down Expand Up @@ -169,7 +171,9 @@
int stacksize; /*Size of thread stack (bytes)*/
struct CthThreadListener *listener; /* pointer to the first of the listeners */

#ifndef _WIN32
unsigned int valgrindStackID;
#endif

#if CMK_THREADS_BUILD_TLS
tlsseg_t tlsseg;
Expand Down Expand Up @@ -438,7 +442,9 @@ static void *CthAllocateStack(CthThreadBase *th,int *stackSize,int useMigratable
_MEMCHECK(ret);
th->stack=ret;

#ifndef _WIN32
th->valgrindStackID = VALGRIND_STACK_REGISTER(ret, ret + *stackSize);
#endif

return ret;
}
Expand Down Expand Up @@ -475,7 +481,9 @@ static void CthThreadBaseFree(CthThreadBase *th)
else if (th->stack!=NULL) {
free(th->stack);
}
#ifndef _WIN32
VALGRIND_STACK_DEREGISTER(th->valgrindStackID);
#endif
th->stack=NULL;
}

Expand Down

0 comments on commit 8ecbc84

Please sign in to comment.