From 492704668671e0955a764a4923840cafd8b13bec Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 20 Aug 2024 12:27:00 +0800 Subject: [PATCH] ST: Refine macro for valgrind. --- trunk/3rdparty/st-srs/common.h | 11 +---------- trunk/3rdparty/st-srs/sched.c | 6 +++--- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/trunk/3rdparty/st-srs/common.h b/trunk/3rdparty/st-srs/common.h index 1e520864ad..903aee48e6 100644 --- a/trunk/3rdparty/st-srs/common.h +++ b/trunk/3rdparty/st-srs/common.h @@ -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 @@ -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; diff --git a/trunk/3rdparty/st-srs/sched.c b/trunk/3rdparty/st-srs/sched.c index 253b25231c..e26c327eb7 100644 --- a/trunk/3rdparty/st-srs/sched.c +++ b/trunk/3rdparty/st-srs/sched.c @@ -50,7 +50,7 @@ #include "common.h" /* merge from https://github.com/toffaletti/state-threads/commit/7f57fc9acc05e657bca1223f1e5b9b1a45ed929b */ -#ifndef NVALGRIND +#ifdef MD_VALGRIND #include #endif @@ -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); } @@ -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); }