Volatile (keyword): Difference between revisions
Jump to navigation
Jump to search
[unchecked revision] | [unchecked revision] |
Content deleted Content added
mNo edit summary |
|||
Line 1: | Line 1: | ||
== Definition == |
== Definition == |
||
The volatile |
The volatile keyword gives an indication to the compiler/optimizer that it should always perform a read or write to a variable or memory without caching it locally. It also ensures that the order of changes is preserved and not altered by the optimizer, and that apparently redundant code is not optimized away. |
||
== The basics == |
== The basics == |
||
Line 82: | Line 82: | ||
} |
} |
||
Also see |
Also see the [[APIC#IO_APIC_Configuration|APIC example code]] where the volatile keyword is crucial (reading/writing to hardware registers). |