浏览代码

+ add method get_dynarray_header_size to retrieve the size of the dynamic array meta data record

git-svn-id: trunk@39038 -
svenbarth 7 年之前
父节点
当前提交
d3d9221c8d
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. 12 1
      compiler/aasmcnst.pas

+ 12 - 1
compiler/aasmcnst.pas

@@ -453,9 +453,10 @@ type
        record (also if that field is a nested anonymous record) }
        record (also if that field is a nested anonymous record) }
      property next_field_name: TIDString write set_next_field_name;
      property next_field_name: TIDString write set_next_field_name;
     protected
     protected
-     { this one always return the actual offset, called by the above (and
+     { these ones always return the actual offset, called by the above (and
        overridden versions) }
        overridden versions) }
      class function get_string_header_size(typ: tstringtype; winlikewidestring: boolean): pint;
      class function get_string_header_size(typ: tstringtype; winlikewidestring: boolean): pint;
+     class function get_dynarray_header_size:pint;
    end;
    end;
    ttai_typedconstbuilderclass = class of ttai_typedconstbuilder;
    ttai_typedconstbuilderclass = class of ttai_typedconstbuilder;
 
 
@@ -1152,6 +1153,16 @@ implementation
      end;
      end;
 
 
 
 
+   class function ttai_typedconstbuilder.get_dynarray_header_size:pint;
+     begin
+       result:=
+         { reference count }
+         ptrsinttype.size +
+         { high value }
+         sizesinttype.size;
+     end;
+
+
    constructor ttai_typedconstbuilder.create(const options: ttcasmlistoptions);
    constructor ttai_typedconstbuilder.create(const options: ttcasmlistoptions);
      begin
      begin
        inherited create;
        inherited create;