Skip to content

Commit a6b873c

Browse files
committed
Update on "Add segment_data_size to extended header"
Store the segment data size. Allows us to calculate the total PTE file size and error out if the full PTE file was not downloaded. Next diff: check file size at runtime. Differential Revision: [D81829663](https://our.internmc.facebook.com/intern/diff/D81829663/) [ghstack-poisoned]
1 parent 8c584b7 commit a6b873c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/source/pte-file-format.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Optional extended header:
7272
| [24..31] uint64_t offset (from byte offset zero above) to the start of the
7373
| first segment, or zero if there are no segments.
7474
| [32..39] uint64_t size of the segment data, ie. the size from the segment_base_offset
75-
| to the end of the file
75+
| to the end of the segments.
7676
| [40..?] Any zero-padding necessary to preserve the alignment of the data
7777
| that follows.
7878
End of optional extended header.

exir/_serialize/_program.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ class _ExtendedHeader:
157157
# Offset to the start of the first segment, or zero if there
158158
# are no segments.
159159
segment_base_offset: int
160-
# Size of the segment data, in bytes, or zero if there are no segments.
160+
# Size of the segment data, in bytes, or zero if there are no segments, or
161+
# if the this field isn't populated in the PTE file.
161162
segment_data_size: int
162163

163164
# The magic bytes read from or to be written to the binary header.

0 commit comments

Comments
 (0)