[Mesa-dev] [PATCH 03/15] mesa: Add a clone function to mesa hash
Brian Paul
brianp at vmware.com
Tue Aug 27 07:29:00 PDT 2013
On 08/26/2013 07:10 PM, Timothy Arceri wrote:
> On 27/08/13 00:51, Brian Paul wrote:
>> On 08/26/2013 04:43 AM, Timothy Arceri wrote:
>>>
>>> Signed-off-by: Timothy Arceri <t_arceri at yahoo.com.au>
>>> ---
>>> src/mesa/main/hash.c | 26 ++++++++++++++++++++++++++
>>> src/mesa/main/hash.h | 3 +++
>>> 2 files changed, 29 insertions(+)
>>>
>>> diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c
>>> index 6591af9..8dde8b1 100644
>>> --- a/src/mesa/main/hash.c
>>> +++ b/src/mesa/main/hash.c
>>> @@ -302,6 +302,32 @@ _mesa_HashDeleteAll(struct _mesa_HashTable *table,
>>>
>>>
>>> /**
>>> + * Clone all entries in a hash table, into a new table.
>>> + *
>>> + * \param table the hash table to clone
>>> + */
>>> +struct _mesa_HashTable *
>>> +_mesa_HashClone(struct _mesa_HashTable *table)
>>
>> Can that be const qualified?
>>
>
> The cloned tables are to be edited after we clone them. Basically we
> just want a copy of whats on the top of the stack when we do a push but
> then the we want to be able to be able to add more ids to this copy if
> we want to. I have a piglit test for push/popDebugGroup that shows what
> I mean.
> I will try to polish this up and submit it later today.
>
> Or I'm I miss understanding what you are suggesting?
I'm simply asking if the 'table' function parameter can be
const-qualified. Normally, when you clone an object you don't modify
the original object, so I'd assume that it could be const.
-Brian
More information about the mesa-dev
mailing list