[Mesa-dev] [PATCH 3/7] mesa: Shrink the size of the enum string lookup struct.
Brian Paul
brian.e.paul at gmail.com
Sat Sep 21 07:59:14 PDT 2013
On Fri, Sep 20, 2013 at 7:52 PM, Eric Anholt <eric at anholt.net> wrote:
> 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.
> ---
> src/mapi/glapi/gen/gl_enums.py | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/mapi/glapi/gen/gl_enums.py b/src/mapi/glapi/gen/gl_enums.py
> index e1ab600..6f54b06 100644
> --- a/src/mapi/glapi/gen/gl_enums.py
> +++ b/src/mapi/glapi/gen/gl_enums.py
> @@ -47,8 +47,8 @@ class PrintGlEnums(gl_XML.gl_print_base):
> print '#include "main/imports.h"'
> print '#include "main/mtypes.h"'
> print ''
> - print 'typedef struct {'
> - print ' size_t offset;'
> + print 'typedef struct __attribute__((__packed__)) {'
I don't know if that'll work with MSVC. To be safe, we should probably
wrap that in a #ifdef gcc test.
-Brian
More information about the mesa-dev
mailing list