Mesa (master): mesa: Fix helgrind complaint about one-time init

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 24 21:24:54 UTC 2020


Module: Mesa
Branch: master
Commit: f7102ac376a23a394786085a2b0dffa94c13150c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f7102ac376a23a394786085a2b0dffa94c13150c

Author: Rob Clark <robdclark at chromium.org>
Date:   Tue Nov 17 14:29:59 2020 -0800

mesa: Fix helgrind complaint about one-time init

Signed-off-by: Rob Clark <robdclark at chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7644>

---

 src/mesa/math/m_eval.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/math/m_eval.c b/src/mesa/math/m_eval.c
index f0c7190b799..94c72dffdd5 100644
--- a/src/mesa/math/m_eval.c
+++ b/src/mesa/math/m_eval.c
@@ -36,6 +36,7 @@
  * Thanks guys!
  */
 
+#include "util/debug.h"
 
 #include "main/glheader.h"
 #include "main/config.h"
@@ -456,6 +457,7 @@ _math_init_eval(void)
 
    /* KW: precompute 1/x for useful x.
     */
-   for (i = 1; i < MAX_EVAL_ORDER; i++)
-      inv_tab[i] = 1.0F / i;
+   do_once
+      for (i = 1; i < MAX_EVAL_ORDER; i++)
+         inv_tab[i] = 1.0F / i;
 }



More information about the mesa-commit mailing list