Skip to content

Commit

Permalink
ST: Refine macro for valgrind.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Aug 21, 2024
1 parent 201c2cb commit 4927046
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
11 changes: 1 addition & 10 deletions trunk/3rdparty/st-srs/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@
extern "C" {
#endif

/* merge from https://github.com/toffaletti/state-threads/commit/7f57fc9acc05e657bca1223f1e5b9b1a45ed929b */
#ifndef MD_VALGRIND
#ifndef NVALGRIND
#define NVALGRIND
#endif
#else
#undef NVALGRIND
#endif


/*****************************************
* Circular linked list definitions
Expand Down Expand Up @@ -121,7 +112,7 @@ typedef struct _st_stack {
char *stk_top; /* Highest address of stack's usable portion */
void *sp; /* Stack pointer from C's point of view */
/* merge from https://github.com/toffaletti/state-threads/commit/7f57fc9acc05e657bca1223f1e5b9b1a45ed929b */
#ifndef NVALGRIND
#ifdef MD_VALGRIND
/* id returned by VALGRIND_STACK_REGISTER */
/* http://valgrind.org/docs/manual/manual-core-adv.html */
unsigned long valgrind_stack_id;
Expand Down
6 changes: 3 additions & 3 deletions trunk/3rdparty/st-srs/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include "common.h"

/* merge from https://github.com/toffaletti/state-threads/commit/7f57fc9acc05e657bca1223f1e5b9b1a45ed929b */
#ifndef NVALGRIND
#ifdef MD_VALGRIND
#include <valgrind/valgrind.h>
#endif

Expand Down Expand Up @@ -310,7 +310,7 @@ void st_thread_exit(void *retval)
#endif

/* merge from https://github.com/toffaletti/state-threads/commit/7f57fc9acc05e657bca1223f1e5b9b1a45ed929b */
#ifndef NVALGRIND
#ifdef MD_VALGRIND
if (!(thread->flags & _ST_FL_PRIMORDIAL)) {
VALGRIND_STACK_DEREGISTER(thread->stack->valgrind_stack_id);
}
Expand Down Expand Up @@ -686,7 +686,7 @@ _st_thread_t *st_thread_create(void *(*start)(void *arg), void *arg, int joinabl
#endif

/* merge from https://github.com/toffaletti/state-threads/commit/7f57fc9acc05e657bca1223f1e5b9b1a45ed929b */
#ifndef NVALGRIND
#ifdef MD_VALGRIND
if (!(thread->flags & _ST_FL_PRIMORDIAL)) {
thread->stack->valgrind_stack_id = VALGRIND_STACK_REGISTER(thread->stack->stk_top, thread->stack->stk_bottom);
}
Expand Down

0 comments on commit 4927046

Please sign in to comment.