summaryrefslogtreecommitdiff
path: root/src/gallium/include
diff options
context:
space:
mode:
authorYonggang Luo <luoyonggang@gmail.com>2022-11-19 07:34:59 +0800
committerMarge Bot <emma+marge@anholt.net>2022-11-24 06:21:39 +0000
commitb0203b5d47bb7910fb855099d53f96a59d3942e6 (patch)
tree5677aaa3696a352627c85119e33ad7604f6c09a5 /src/gallium/include
parent50ab93afdea53a49e353616231b3c654c5018794 (diff)
util: Move EXCLUSIVE_CACHELINE and CACHE_LINE_SIZE macros into u_memory.h
They are coupled with MALLOC_STRUCT_CL, so move them into a single place and accessed consistently Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19918>
Diffstat (limited to 'src/gallium/include')
-rw-r--r--src/gallium/include/pipe/p_compiler.h18
-rw-r--r--src/gallium/include/pipe/p_state.h2
2 files changed, 2 insertions, 18 deletions
diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h
index 070224fb4bd..7d1ddd84f86 100644
--- a/src/gallium/include/pipe/p_compiler.h
+++ b/src/gallium/include/pipe/p_compiler.h
@@ -86,24 +86,6 @@ typedef unsigned char boolean;
#define PIPE_CDECL
#endif
-/**
- * Declare a variable on its own cache line.
- *
- * This helps eliminate "False sharing" to make atomic operations
- * on pipe_reference::count faster and/or access to adjacent fields faster.
- *
- * https://en.wikipedia.org/wiki/False_sharing
- *
- * CALLOC_STRUCT_CL or MALLOC_STRUCT_CL and FREE_CL should be used to allocate
- * structures that contain this.
- *
- * NOTE: Don't use c11 alignas because it causes the whole structure to be
- * aligned, but we only want to align the field.
- */
-#define EXCLUSIVE_CACHELINE(decl) \
- union { char __cl_space[CACHE_LINE_SIZE]; \
- decl; }
-
#if defined(__cplusplus)
}
#endif
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index e2003f3369f..d73929905c9 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -44,6 +44,8 @@
#ifndef PIPE_STATE_H
#define PIPE_STATE_H
+#include "util/u_memory.h"
+
#include "p_compiler.h"
#include "p_defines.h"
#include "util/format/u_formats.h"