Skip to content

Commit e8d5faa

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#2158 from walbourn/patch-1
Update pack.md
2 parents 3ec6048 + f764535 commit e8d5faa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/preprocessor/pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The statement `#pragma pack (pop, r1, 2)` is equivalent to `#pragma pack (pop, r
3737

3838
## Remarks
3939

40-
To *pack* a class is to place its members directly after each other in memory. It can mean that some or all members can be aligned on a boundary smaller than the default alignment of the target architecture. **pack** gives control at the data-declaration level. It differs from compiler option [/Zp](../build/reference/zp-struct-member-alignment.md), which only provides module-level control. **pack** takes effect at the first **struct**, **union**, or **class** declaration after the pragma is seen. **pack** has no effect on definitions. Calling **pack** with no arguments sets *n* to the value set in the compiler option `/Zp`. If the compiler option isn't set, the default value is 8.
40+
To *pack* a class is to place its members directly after each other in memory. It can mean that some or all members can be aligned on a boundary smaller than the default alignment of the target architecture. **pack** gives control at the data-declaration level. It differs from compiler option [/Zp](../build/reference/zp-struct-member-alignment.md), which only provides module-level control. **pack** takes effect at the first **struct**, **union**, or **class** declaration after the pragma is seen. **pack** has no effect on definitions. Calling **pack** with no arguments sets *n* to the value set in the compiler option `/Zp`. If the compiler option isn't set, the default value is 8 for x86, ARM, and ARM64. The default is 16 for x64 native.
4141

4242
If you change the alignment of a structure, it may not use as much space in memory, but you may see a decrease in performance or even get a hardware-generated exception for unaligned access. You can modify this exception behavior by using [SetErrorMode](/windows/win32/api/errhandlingapi/nf-errhandlingapi-seterrormode).
4343

0 commit comments

Comments
 (0)