[Mesa-dev] [PATCH] util: convert slab macros to inline functions

Brian Paul brianp at vmware.com
Fri Mar 13 06:58:34 PDT 2015


On 03/13/2015 07:52 AM, Jose Fonseca wrote:
> On 12/03/15 23:08, Brian Paul wrote:
>> On 03/12/2015 05:03 PM, Matt Turner wrote:
>>> On Thu, Mar 12, 2015 at 2:54 PM, Brian Paul <brianp at vmware.com> wrote:
>>>> ---
>>>>   src/gallium/auxiliary/util/u_slab.h | 13 +++++++++++--
>>>>   1 file changed, 11 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/src/gallium/auxiliary/util/u_slab.h
>>>> b/src/gallium/auxiliary/util/u_slab.h
>>>> index 29d0252..8f8b29b 100644
>>>> --- a/src/gallium/auxiliary/util/u_slab.h
>>>> +++ b/src/gallium/auxiliary/util/u_slab.h
>>>> @@ -81,7 +81,16 @@ void util_slab_destroy(struct util_slab_mempool
>>>> *pool);
>>>>   void util_slab_set_thread_safety(struct util_slab_mempool *pool,
>>>>                                    enum util_slab_threading threading);
>>>>
>>>> -#define util_slab_alloc(pool)     (pool)->alloc(pool)
>>>> -#define util_slab_free(pool, ptr) (pool)->free(pool, ptr)
>>>> +static INLINE void *
>>>
>>> Maybe I'm making this up, but I was thinking there had been some work
>>> toward replacing INLINE with inline. If so, is this a candidate to use
>>> inline?
>>
>> In the gallium code it's still INLINE everywhere.
>>
>> If someone's looking for a relatively easy task, s/INLINE/inline/ in
>> src/gallium/ could be a good project.
>>
>> -Brian
>>
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=AwIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzE&m=rGfylYa2k0oysjifqk0YWg_X6NwDpRuLbSo2C62uIGs&s=Lf1lIiSmYn2QxLtOaemBMHcnYaQAnM3U8UYE-m9eOZ0&e=
>>
>>
>
> p_compiler.h includes c99_compat.h so there's nothing preventing new
> code from using inline.

You're right.  I'll change it to inline.  R-b?

-Brian




More information about the mesa-dev mailing list