| ... | @@ -64,7 +64,10 @@ const SystemLib = struct { | ... | @@ -64,7 +64,10 @@ const SystemLib = struct { |
| 64 | const Section = struct { | 64 | const Section = struct { |
| 65 | header: macho.section_64, | 65 | header: macho.section_64, |
| 66 | segment_index: u8, | 66 | segment_index: u8, |
| 67 | last_atom: ?*Atom = null, // TODO temporary hack; we really should shrink section to 0 | 67 | |
| | 68 | // TODO is null here necessary, or can we do away with tracking via section |
| | 69 | // size in incremental context? |
| | 70 | last_atom: ?*Atom = null, |
| 68 | | 71 | |
| 69 | /// A list of atoms that have surplus capacity. This list can have false | 72 | /// A list of atoms that have surplus capacity. This list can have false |
| 70 | /// positives, as functions grow and shrink over time, only sometimes being added | 73 | /// positives, as functions grow and shrink over time, only sometimes being added |
| ... | @@ -4434,8 +4437,8 @@ fn initSection( | ... | @@ -4434,8 +4437,8 @@ fn initSection( |
| 4434 | } | 4437 | } |
| 4435 | header.addr = seg.vmaddr + off - seg.fileoff; | 4438 | header.addr = seg.vmaddr + off - seg.fileoff; |
| 4436 | | 4439 | |
| 4437 | // TODO this will break if we are inserting section that is not the last section | 4440 | // TODO Will this break if we are inserting section that is not the last section |
| 4438 | // in a segment. | 4441 | // in a segment? |
| 4439 | const max_size = self.allocatedSize(segment_id, off); | 4442 | const max_size = self.allocatedSize(segment_id, off); |
| 4440 | | 4443 | |
| 4441 | if (size > max_size) { | 4444 | if (size > max_size) { |