authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-06-04 23:22:40+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-06-05 07:17:40+02:00
logadc4418bae54e51921cde937d96faebf576f6d0c
tree0e18fe0fcd17b16ad5143ee6bddaa6860dffbdfd
parent9d534790ebc869ec933e932abe4be8b9e3593bbc

std.fs.Dir.Iterator: Address a couple of alignment TODOs.


1 files changed, 2 insertions(+), 4 deletions(-)

lib/std/fs/Dir.zig+2-4
......@@ -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,