Click here to Skip to main content
15,917,568 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Windows Spy++ Utility Pin
Jon Hulatt3-Aug-05 23:10
Jon Hulatt3-Aug-05 23:10 
GeneralRe: Windows Spy++ Utility Pin
ddmcr3-Aug-05 23:26
ddmcr3-Aug-05 23:26 
GeneralRe: Windows Spy++ Utility Pin
Blake Miller4-Aug-05 4:55
Blake Miller4-Aug-05 4:55 
GeneralMetaFiles Pin
popo843-Aug-05 22:31
popo843-Aug-05 22:31 
GeneralRe: MetaFiles Pin
badal_akr4-Aug-05 0:33
badal_akr4-Aug-05 0:33 
QuestionStructure Alignment? Pin
badal_akr3-Aug-05 22:29
badal_akr3-Aug-05 22:29 
AnswerRe: Structure Alignment? Pin
Halawlaws3-Aug-05 23:08
Halawlaws3-Aug-05 23:08 
AnswerRe: Structure Alignment? Pin
Halawlaws3-Aug-05 23:10
Halawlaws3-Aug-05 23:10 
Or maybe this can help too:

All modern CPUs expect that fundamental types like ints, longs and floats will be stored in memory at addresses that are multiples of their length.

CPUs are optimized for accessing memory aligned in this way.

Some CPUs:


allow unaligned access but at a performance penalty;

trap unaligned accesses to the operating system where they can either be ignored, simulated or reported as errors;

use unaligned addresses as a means of doing special operations during the load or store.

When a C compiler processes a structure declaration, it can:


add extra bytes between the fields to ensure that all fields requiring alignment are properly aligned;

ensure that instances of the structure as a whole are properly aligned. Malloc always returns memory pointers that are aligned for the strictest, fundamental machine type.

The specifications for C/C++ state that the existence and nature of these padding bytes are implementation defined. This means that each CPU/OS/Compiler combination is free to use whatever alignment and padding rules are best for their purposes. Programmers however are not supposed to assume that specific padding and alignment rules will be followed. There are no controls defined within the language for indicating special handling of alignment and padding although many compilers like gcc have non-standard extensions to permit this.


Summary

Structure Alignment
Structure alignment may be defined as the choice of rules which determine when and where padding is inserted together with the optimizations which the compiler is able to effect in generated code.



/\|-||\/|/\|)
GeneralRe: Structure Alignment? Pin
badal_akr4-Aug-05 0:41
badal_akr4-Aug-05 0:41 
GeneralRe: Structure Alignment? Pin
Blake Miller4-Aug-05 5:04
Blake Miller4-Aug-05 5:04 
GeneralRe: Structure Alignment? Pin
GKarRacer5-Aug-05 9:38
GKarRacer5-Aug-05 9:38 
Generalproblems while assigning CString object. Pin
a_david1233-Aug-05 22:03
a_david1233-Aug-05 22:03 
GeneralRe: problems while assigning CString object. Pin
toxcct3-Aug-05 22:11
toxcct3-Aug-05 22:11 
GeneralRe: problems while assigning CString object. Pin
Eytukan3-Aug-05 23:46
Eytukan3-Aug-05 23:46 
GeneralClose Open Windows with Escape-Key Pin
Daniel Gerstner3-Aug-05 21:38
Daniel Gerstner3-Aug-05 21:38 
GeneralRe: Close Open Windows with Escape-Key Pin
Daniel Gerstner3-Aug-05 23:01
Daniel Gerstner3-Aug-05 23:01 
GeneralRe: Close Open Windows with Escape-Key Pin
Blake Miller4-Aug-05 5:06
Blake Miller4-Aug-05 5:06 
GeneralRe: Close Open Windows with Escape-Key Pin
Daniel Gerstner4-Aug-05 19:02
Daniel Gerstner4-Aug-05 19:02 
GeneralRe: Close Open Windows with Escape-Key Pin
Blake Miller5-Aug-05 6:04
Blake Miller5-Aug-05 6:04 
QuestionHow to Do printing Activexcontol Pin
sjsankar3-Aug-05 21:37
sjsankar3-Aug-05 21:37 
GeneralObject oriented software metrics Pin
ilgale3-Aug-05 21:21
ilgale3-Aug-05 21:21 
QuestionThe Command Line paramters passed to other processes? Pin
Julien3-Aug-05 19:47
Julien3-Aug-05 19:47 
AnswerRe: The Command Line paramters passed to other processes? Pin
Garth J Lancaster3-Aug-05 21:24
professionalGarth J Lancaster3-Aug-05 21:24 
GeneralSample source code for TCP programming Pin
Member 21610043-Aug-05 19:37
Member 21610043-Aug-05 19:37 
GeneralRe: Sample source code for TCP programming Pin
Abebe3-Aug-05 20:23
Abebe3-Aug-05 20:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.