Hi Andrew,

>>>> +
>>>> +void *_xvrealloc(void *va, size_t size, unsigned int align)
>>>> +{
>>>> +    return _xrealloc(va, size, align);
>>>> +}
>>>> +
>>>> +#endif
>>> Does this really compile with the wrappers not being static inline ?
>>> 
>>> That aside, could we not do this using conditional aliases, rather than
>>> wrapping the functions?  It would certainly be shorter, code wise.
>> Do you mean something like below?
>> 
>> #define xvfree xfree
>> #define _xvmalloc _xmalloc
>> […]
> 
> I mean __attribute__((__alias__("")))
> 
> There are two examples in tree already.  See efi_compat_get_info() being
> aliased to efi_get_info()
> 
> In this case, in the !HAS_VMAP case, we'd just declare _xmalloc() to
> have an alias called _xvmalloc() too.
> 
> This avoids needing to wrap every function in the headers.

I’m getting:

error: ‘xvfree’ aliased to undefined symbol ‘xfree’

looking into the documentation it says:

“It is an error if the alias target is not defined in the same translation unit 
as the alias."

So I think I can’t use this one here.

Should I continue to do in the other way? Or using #define?

> 
> ~Andrew

Reply via email to