File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
content/courses/advanced-ada/parts/data_types Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -662,9 +662,14 @@ a test application:
662662The example contains assignments such as :ada: `WR.Horizontal_Cnt := 800 ` and
663663:ada: `WR.Vertical_Cnt:= 600 `. Because :ada: `Window_Register ` is a full-access
664664type, these assignments are performed for the complete 32-bit register, even
665- though we're updating just a single component of the record object. (Note that
666- if :ada: `Window_Register ` wasn't a *full-access * object, an assignment such as
667- :ada: `WR.Horizontal_Cnt := 800 ` could be performed with a 16-bit operation.)
665+ though we're updating just a single component of the record object.
666+
667+ Note that if :ada: `Window_Register ` wasn't a *full-access * object, an
668+ assignment such as :ada: `WR.Horizontal_Cnt := 800 ` could be performed with a
669+ 16-bit operation. In fact, this is what a compiler would most probably select
670+ for this assignment, because that is more efficient than manipulating the
671+ entire object. Therefore, using a *full-access * object prevents the compiler
672+ from generating operations that could lead to unexpected results.
668673
669674Whenever possible, this *full-access * assignment is performed in a single
670675machine operation. However, if it's not possible to generate a single machine
You can’t perform that action at this time.
0 commit comments