Skip to content

Commit adc4418

Browse files
committed
std.fs.Dir.Iterator: Address a couple of alignment TODOs.
1 parent 9d53479 commit adc4418

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/std/fs/Dir.zig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub const Iterator = switch (native_os) {
2424
.macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos => struct {
2525
dir: Dir,
2626
seek: i64,
27-
buf: [1024]u8, // TODO align(@alignOf(posix.system.dirent)),
27+
buf: [1024]u8 align(@alignOf(posix.system.dirent)),
2828
index: usize,
2929
end_index: usize,
3030
first_iter: bool,
@@ -328,8 +328,6 @@ pub const Iterator = switch (native_os) {
328328
},
329329
.linux => struct {
330330
dir: Dir,
331-
// The if guard is solely there to prevent compile errors from missing `linux.dirent64`
332-
// definition when compiling for other OSes. It doesn't do anything when compiling for Linux.
333331
buf: [1024]u8 align(@alignOf(linux.dirent64)),
334332
index: usize,
335333
end_index: usize,
@@ -490,7 +488,7 @@ pub const Iterator = switch (native_os) {
490488
},
491489
.wasi => struct {
492490
dir: Dir,
493-
buf: [1024]u8, // TODO align(@alignOf(posix.wasi.dirent_t)),
491+
buf: [1024]u8 align(@alignOf(std.os.wasi.dirent_t)),
494492
cookie: u64,
495493
index: usize,
496494
end_index: usize,

0 commit comments

Comments
 (0)