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

  • 相关阅读:
    IDEA
    SpringCloud
    Docker
    Docker
    JDK排序
    选择排序
    冒泡排序
    计算一个整数数组的平均数
    (if语句)中国的个税计算方法
    读入一个表示年份的整数,判断这一年是否是闰年
  • 原文地址:https://www.cnblogs.com/h2zZhou/p/6774624.html
Copyright © 2011-2022 走看看