[PATCH] New condvar implementation that provides stronger ordering guarantees.
Florian Weimer
fweimer@redhat.com
Wed Jun 15 07:07:00 GMT 2016
On 06/14/2016 10:40 PM, Carlos O'Donell wrote:
> On 06/14/2016 04:14 PM, Florian Weimer wrote:
>>> I believe pthread_cond_common.c is similar. It doesn't use the
>>> preprocessor to alter any behavior, but just uses C to provide
>>> commonly used functionality. It doesn't provide any functions that
>>> are just declarations, so something a C header would typically do.
>>
>> We already have header files which contain inline functions,
>> something that is quite natural.
>
> These are usually marked 'always inline' though aren't they? They
> are basically equivalent to enhanced macros.
They are usually marked inline. But there are exceptions, e.g.
sysdeps/unix/sysv/linux/default-sched.h.
It's also not completely clear to me if other case just use âstatic
inlineâ to suppress the unused function warning.
>> If the functions are not expected to be inlined, you should put them
>> in their own file, and declare them with attribute_hidden for PLT
>> avoidance.
>
> I think the point here is that they may be inlined and we want to
> leave it up to the compiler to decide.
But the compiler cannot make well-informed decisions because it will
assume that static functions are local to the current translation, when
it fact they are not (from the perspective of the cost in terms of code
size of not inlining them).
Anyway, I still prefer the current split over putting everything into a
single source file.
Thanks,
Florian
More information about the Libc-alpha
mailing list