Re: Smashing the Stack?

From: Sebastian Hegenbart (pr1@u-n-f.com)
Date: 07/20/02


Date: Sat, 20 Jul 2002 18:31:35 +0200
From: Sebastian Hegenbart <pr1@u-n-f.com>
To: strange@nsk.yi.org


 On Wed, 17 Jul 2002 21:11:21 +0100
 strange@nsk.yi.org wrote:
 
> On Wed, Jul 17, 2002 at 01:34:38PM -0400, Eric Thomas wrote:
> >
> > I went through this same mystery a few months ago. Apparently GCC pads
> > the generated assembly for better memory alignment, which makes certain
> > operations faster.
>
> And in some archs, legal. Non-align memory access is illegal in some archs,
> and non-existant in others (MIPS ignores the last 2/4(?) bits, anyway).
 
 
Note that writing to unaligned memory addresses is a CPU feature of
the x86 family. The CPU will complain if the AC ( alignment check ) flag
is set in the flag register.
 
lates pr1
  



Relevant Pages

  • Portable Measurement of Pointer Alignment in C?
    ... A lot of low level cryptographic code and some hardware cryptographic accelerators either fail completely or perform very poorly if their input, ... output and/or key storage areas in memory are not aligned on specific memory boundaries. ... This hence rasises the question of the most appropriate way of determining the memory alignment of the memory referenced by a pointer in C. ...
    (comp.lang.c)
  • Re: Portable Measurement of Pointer Alignment in C?
    ... output and/or key storage areas in memory are not aligned on specific memory ... the memory alignment of the memory referenced by a pointer in C. ... the practical portability of ways to determine the physical alignment of the ...
    (comp.lang.c)
  • Re: memory alignment
    ... The mechanism of memory alignment is not defined by the C language ... standard, the standard merely allows an implementation to require it ... int has 32 bits and the processor has a 32-bit path to memory. ...
    (comp.lang.c)
  • Re: Portable Measurement of Pointer Alignment in C?
    ... output and/or key storage areas in memory are not aligned on specific memory ... boundaries. ... the memory alignment of the memory referenced by a pointer in C. ...
    (comp.lang.c)
  • Re: String or Numeric Variable?
    ... > second and memory footprint is not as big an issue as it used to be. ... > an array of BYTEs will be smaller in memory than an array of LONGs. ... > You only really have to 'worry' about memory alignment when using UDTs, ... > Give a man a beer he wastes an hour...Teach a man to brew and he wastes a ...
    (comp.lang.basic.visual.misc)