Skip to content

RediWM is a Wayland compositor written in Zig (OpenGL ES) that includes everything in one process

Complete copy path allocation profiling

Melfae6c07374b4
diff --git a/src/files/ops.zig b/src/files/ops.zig
index b9654cb..0df15b7 100644
--- a/src/files/ops.zig
+++ b/src/files/ops.zig
@@ -1846,6 +1846,7 @@ pub const JobRunner = struct {
const owned = try self.allocator.alloc(u8, path.len);
errdefer self.allocator.free(owned);
@memcpy(owned, path);
+ self.profilePathAllocation(path.len);
_ = c.pthread_mutex_lock(&self.mutex);
defer _ = c.pthread_mutex_unlock(&self.mutex);
@@ -2068,6 +2069,7 @@ pub const JobRunner = struct {
const unique = try generateUniqueName(self.allocator, self.dest_dir, name);
defer self.allocator.free(unique);
const replacement = try std.fmt.allocPrint(self.allocator, "{s}/{s}", .{ self.dest_dir, unique });
+ self.profilePathAllocation(replacement.len);
self.allocator.free(target);
target = replacement;
},