[Mesa-dev] [PATCH 03/20] glapi: Store static dispatch offsets in a separate table

Dylan Baker baker.dylan.c at gmail.com
Fri May 15 12:14:30 PDT 2015


On Wed, May 13, 2015 at 12:44:31PM -0700, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>

[snip]

> diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py
> new file mode 100644
> index 0000000..2ce093c
> --- /dev/null
> +++ b/src/mapi/glapi/gen/static_data.py
> @@ -0,0 +1,436 @@
> +#!/usr/bin/env python
> +
> +# Copyright (C) 2015 Intel Corporation
> +#
> +# Permission is hereby granted, free of charge, to any person obtaining a
> +# copy of this software and associated documentation files (the "Software"),
> +# to deal in the Software without restriction, including without limitation
> +# the rights to use, copy, modify, merge, publish, distribute, sublicense,
> +# and/or sell copies of the Software, and to permit persons to whom the
> +# Software is furnished to do so, subject to the following conditions:
> +#
> +# The above copyright notice and this permission notice (including the next
> +# paragraph) shall be included in all copies or substantial portions of the
> +# Software.
> +#
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> +# IN THE SOFTWARE.
> +
> +"""Table of functions that have ABI-mandated offsets in the dispatch table.
> +
> +This list will never change."""

As a nit, putting a newline between the table and the docstring is nice.

The only thing I wonder is does it make more sense to save this table as
a json document and use json.load instead of storing it as python? It is
just data with no function calls or definitions. It doesn't matter too
much to me either way though.

fwiw,
Reviewed-by: Dylan Baker <baker.dylan.c at gmail.com>

> +offsets = {
> +    "NewList": 0,
> +    "EndList": 1,

[snip]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150515/6d387ac8/attachment.sig>


More information about the mesa-dev mailing list