浏览代码

Packed directive added to record TBlockHeader.

Record TBlockHeader is of size 24 bytes on win64 platform.
This is due to quad word alignment in compiler settings.

To force the record into 16 bytes, the packed directive
should be used.

Untested what the side effects could be of this, possibilities:

1. Slight slow down of existing code.
2. Perhaps some memory savings here and there.

The current PascalCoin is not affected because it loads fields
individually. This could be sped up somewhat by loading the blockheader
all at once.
Skybuck Flying 2 年之前
父节点
当前提交
80ef410b03
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/core/UFileStorage.pas

+ 1 - 1
src/core/UFileStorage.pas

@@ -29,7 +29,7 @@ uses
 
 
 
 
 Type
 Type
-  TBlockHeader = Record
+  TBlockHeader = packed record
     BlockNumber : Cardinal;
     BlockNumber : Cardinal;
     StreamBlockRelStartPos : Int64;
     StreamBlockRelStartPos : Int64;
     BlockSize : Cardinal;
     BlockSize : Cardinal;