[Mesa-dev] [PATCH 3/3] mesa: allocate gl_debug_state on demand

Kenneth Graunke kenneth at whitecape.org
Sat Feb 8 09:49:36 PST 2014


On 02/07/2014 04:43 PM, Brian Paul wrote:
> We don't need to allocate all the state related to GL_ARB_debug_output
> until some aspect of that extension is actually needed.
> 
> The sizeof(gl_debug_state) is huge (~285KB on 64-bit systems), not even
> counting the 54(!) hash tables and lists that it contains.  This change
> reduces the size of gl_context alone from 431KB bytes to 145KB bytes on
> 64-bit systems and from 277KB bytes to 78KB bytes on 32-bit systems.
> ---
>  src/mesa/drivers/dri/common/dri_util.c |    6 +-
>  src/mesa/main/enable.c                 |   33 +++-
>  src/mesa/main/errors.c                 |  331 +++++++++++++++++++-------------
>  src/mesa/main/errors.h                 |    3 +
>  src/mesa/main/get.c                    |   21 ++
>  src/mesa/main/get_hash_params.py       |    6 +-
>  src/mesa/main/getstring.c              |   16 +-
>  src/mesa/main/mtypes.h                 |    2 +-
>  src/mesa/state_tracker/st_manager.c    |    9 +-
>  9 files changed, 274 insertions(+), 153 deletions(-)

This looks okay to me.  Thanks for doing this!

All three patches are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140208/de25b84a/attachment.pgp>


More information about the mesa-dev mailing list