qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Initial support for Ilumos build and Illumos-kv


From: Lee Essen
Subject: Re: [Qemu-devel] [PATCH] Initial support for Ilumos build and Illumos-kvm
Date: Fri, 16 Mar 2012 17:15:49 +0000

On 16 Mar 2012, at 16:28, Paolo Bonzini wrote:

> Il 16/03/2012 14:46, Lee Essen ha scritto:
>> It does indeed … this came from the original Joyent code, I must
>> admit I did wonder whether gcc would optimise it away. I did consider
>> adding something to stop gcc complaining, but I don't fully
>> understand why this is necessary given the mlock() bit, so I thought
>> it best to leave it alone.
> 
> "(void) *(volatile char *)p" should work, but a comment would be nice.
> 
> Paolo

This is interesting … just did a little testing …

With no-optimisation that original code is ok, although obviously comes with a 
compiler
warning.

With any optimisation at all the whole thing gets optimised away -- the 
existing illumos/smartos
build looks like it's built with debug set, so no optimisation.

Using volatile as above seems to do the trick nicely.

Thanks,

Lee.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]