zoukankan      html  css  js  c++  java
  • delphi 的结构体对齐关键字

    Align fields (Delphi)

     

    Go Up to Delphi Compiler Directives (List) Index

    Type

    Switch

    Syntax

    {$A+}, {$A-}, {$A1}, {$A2}, {$A4}, {$A8} or {$A16} {$ALIGN ON}, {$ALIGN OFF}, {$ALIGN 1}, {$ALIGN 2}, {$ALIGN 4}, {$ALIGN 8} or {$ALIGN 16}

    Default

    {$A8} {$ALIGN 8}

    Scope

    Local



    Remarks

    The $A directive controls the maximum alignment used by the compiler when introducing padding to align a field.

    In the {$A1} or {$A-} state, fields are never aligned. All record and class structures are packed.

    In the {$A2} state, fields in record types that are declared without the packed modifier and fields in class structures are aligned on word boundaries.

    In the {$A4} state, fields in record types that are declared without the packed modifier and fields in class structures are aligned on doubleword boundaries.

    In the {$A8} or {$A+} state, fields in record types that are declared without the packed modifier and fields in class structures are aligned on quadword boundaries.

    In the {$A16} state, fields in record types that are declared without the packed modifier and fields in class structures are aligned on double quadword boundaries.

    Record type field alignment is described in the Delphi Language Guide at Internal Data Formats (Delphi)#Record_Types.

    Regardless of the state of the $A directive, variables and typed constants are always aligned for optimal access. In the {$A8} state, execution will be faster.

    For OS X applications, stack alignment must be on 16-byte boundaries. For details, see Eli Boling's blog at http://blogs.embarcadero.com/eboling/2009/05/20/5607

  • 相关阅读:
    【NOIP2011】观光公交
    【NOIP2014】飞扬的小鸟
    HDU
    [Tyvj 1728]普通平衡树
    【NOIP2012】 疫情控制
    洛谷P1613 跑路
    [HNOI2002]营业额统计
    3486 ( Interviewe )RMQ
    poj2019 二维RMQ裸题
    动态规划专题
  • 原文地址:https://www.cnblogs.com/h2zZhou/p/6774624.html
Copyright © 2011-2022 走看看