[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] Paper: A Comparison of TCP Implementations, Linux vs. l
From: |
Richard Siegfried |
Subject: |
Re: [lwip-devel] Paper: A Comparison of TCP Implementations, Linux vs. lwIP |
Date: |
Tue, 23 May 2017 09:14:51 +0200 |
> [...]
> The two systems are targeting fundamentally different devices. One result of
> which is we
> try to keep code size to a minimum and in most situations, a function call to
> a central
> place is much smaller than having the code twice in a binary.
Okay, that makes sense.
> The only exception to that
> is if the function is only used once. In C, this is covered by making the
> function static
> inside the C file.
Oh, good to know.
> In contrast to that, it seems to me that Linux often just uses 'inline'
> because someone
> thinks this might speed up things (although the opposite could happen
> depending on cache
> sizes). And you have to really argue hard with them to accept a patch
> removing an 'inline'
> statement.
That's possible, but might change or at least not get worse, since linus
appears to have a quite bad opinion on the inline keyword to, or at
least advocates a restricted and moderate use (
https://www.kernel.org/doc/html/v4.10/process/coding-style.html#the-inline-disease
)
>
>> (The inline keyword is part of C99 standards, or as a gcc extension
>> before that. http://www.greenend.org.uk/rjk/tech/inline.html)
>
> Welcome in the world of embedded compilers. We still target C89.
> *And* welcome in the world of portability: vendor extensions are not allowed!
> Unless I'm
> mistaken, Linux is still limited to GCC (and maybe CLANG).
It's still only gcc. There's a project to patch the code to compile with
clang but they don't seem to be very active or make a lot of progress.
(http://llvm.linuxfoundation.org/index.php/Main_Page)
Thanks
-- Richard
signature.asc
Description: OpenPGP digital signature