Re: Compiling C++ modules

Avi Kivity
2006-04-26T04:39:08Z

Alexander Shishckin wrote:
> On 4/26/06, Avi Kivity <avi@argo.co.il> wrote:
>
>> Not in this case. The constructor is an assignment. The destructor is an
>> if () followed by a delete. In this case, the if () is optimized away so
>> you are left with less generated code than the C case, for the
>> non-exceptional path.
>>
> Relying on compiler optimisations is just as well stupid as hunting
> trialing writespaces in a dark room miles away.
>

It'd like to see the output of 'size vmlinux' with optimizations turned
off. The kernel is full of forwarding functions and constructs that
optimize away to nothing.

Last time I tried, the kernel wouldn't even compile at -O0, but that may
have changed with the always_inline work.

And it is *not relying* on compiler optimizations that is stupid. It
means you're throwing away the work of the compiler folk, and doing it
instead *by hand* at every piece of code you write.

> It's almost about time to quit this thread and show us some code that
> works. (Forked from 2.6.16, bootable on an average amount of
> architectures...)
>

Ha ha.

--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.