1

Topic: To check up data smoothing in storage

There is a lot of code which independently calculates offsets of the data in storage and then there allocates structures. There was a thought - to check up a data smoothing correctness. That is, that in case of incorrect alignment the exception was generated. Do not prompt - as such to implement? It is necessary to compile artfully somehow  or something to cause from WIN API?

2

Re: To check up data smoothing in storage

Hello, Kovalenko Dmitry, you wrote: > There was a thought - to check up a data smoothing correctness. > That is that in case of incorrect alignment the exception was generated. It SetErrorMode with SEM_NOALIGNMENTFAULTEXCEPT. But the matter is that * the Default - exceptions, it is an option them to ungear. * on x86 and x64 normal instructions does not demand alignment. And unusual (demanding alignments) the compiler will not interpose at access under the pointer of a doubtful origin.

3

Re: To check up data smoothing in storage

Hello, Alexander G, you wrote: >> There was a thought - to check up a data smoothing correctness. >> That is that in case of incorrect alignment the exception was generated. AG> it SetErrorMode with SEM_NOALIGNMENTFAULTEXCEPT. I will try, but, in my opinion, it just ungears exception SEM_NOALIGNMENTFAULTEXCEPT The system automatically fixes memory alignment faults and makes them invisible to the application. It does this for the calling process and any descendant processes. This feature is only supported by certain processor architectures. For more information, see the Remarks section.

4

Re: To check up data smoothing in storage

Hello, Kovalenko Dmitry, you wrote: > I Will try, but, in my opinion, it just ungears an exception Yes, ungears. And only on Itanium. Resulted as a reference point where this option to search, and that on 86 and 64 it, actually, is not present as superfluous.

5

Re: To check up data smoothing in storage

Hello, Alexander G, you wrote: AG> Hello, Kovalenko Dmitry, you wrote: >> I Will try, but, in my opinion, it just ungears exception AG> Yes, ungears. And only on Itanium. AG> Resulted as a reference point where this option to search, and that on 86 and 64 it, actually, is not present as superfluous. Tried. GetErrorMode returns 0. Nevertheless, the code char test [2+sizeof (__ int64)] = {}; __ int64 i64 =*reinterpret_cast <const __ int64 *> (&test [2]); works without problems - bar none. In a debugger the tick at an exception "Datatype misalignment" is installed. It is a pity. I am am tormented here with vague doubts - on mine, at me in one.NET application (C#, Win, Intels) were problems with alignment and the exception  was generated...

6

Re: To check up data smoothing in storage

7

Re: To check up data smoothing in storage