summaryrefslogtreecommitdiff
path: root/src/mesa/main/compiler.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-09-19 14:54:13 -0700
committerEric Anholt <eric@anholt.net>2013-09-23 12:45:22 -0700
commit673129e0b936b1c748e988d3f74f3efaab9e5693 (patch)
treef52de6f9d312a47de141ffbee83d1363a60c14c4 /src/mesa/main/compiler.h
parentc0378b6400e9e56df984eb1bc7ef43254740171c (diff)
mesa: Shrink the size of the enum string lookup struct.
Since it's only used for debug information, we can misalign the struct and save the disk space. Another 19k on a 64-bit build. v2: Make a compiler.h macro to only use the attribute if we know we can. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
Diffstat (limited to 'src/mesa/main/compiler.h')
-rw-r--r--src/mesa/main/compiler.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h
index fb7baf84ea4..0f27d5a6643 100644
--- a/src/mesa/main/compiler.h
+++ b/src/mesa/main/compiler.h
@@ -270,6 +270,15 @@ static INLINE GLuint CPU_TO_LE32(GLuint x)
#define NULL 0
#endif
+/* Used to optionally mark structures with misaligned elements or size as
+ * packed, to trade off performance for space.
+ */
+#if (__GNUC__ >= 3)
+#define PACKED __attribute__((__packed__))
+#else
+#define PACKED
+#endif
+
/**
* LONGSTRING macro