Understanding stack allocation and alignment

前端 未结 5 1577
一生所求
一生所求 2021-01-05 19:54

I\'m trying to understand how stack alignment works as described in what is "stack alignment"? but I have trouble getting a small example to demonstrate the said b

5条回答
  •  清酒与你
    2021-01-05 20:08

    I've never heard about such a thing as specific stack alignment. If there is alignment requirements for the CPU, alignment is done on all kinds of data memory, no matter if it is stored on the stack or elsewhere. It is starting on an even addresses with 16, 32 or 64 bit of data following.

    16 bytes may perhaps be some sort of on-chip cache memory optimization, though that seems a bit far-fetched to me.

提交回复
热议问题