tangled
alpha
login
or
join now
altagos.dev
/
austin-converter
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
condense sample deinit
altagos.dev
8 months ago
bc3dd573
79132158
verified
This commit was signed with the committer's
known signature
.
altagos.dev
SSH Key Fingerprint:
SHA256:UbTjEcCZlc6GzQWLCuDK3D//HESWD2xFPkzue9XMras=
+11
-31
1 changed file
expand all
collapse all
unified
split
src
austin.zig
+11
-31
src/austin.zig
···
35
35
process: Process,
36
36
frames: []FrameWrapper,
37
37
metric: Metric,
38
38
-
39
39
-
fn deinit(self: *Sample, allocator: mem.Allocator) void {
40
40
-
for (self.frames) |frame| {
41
41
-
switch (frame) {
42
42
-
.invalid => {},
43
43
-
.call_stack => |stack| {
44
44
-
allocator.free(stack.module);
45
45
-
allocator.free(stack.function);
46
46
-
},
47
47
-
}
48
48
-
}
49
49
-
50
50
-
allocator.free(self.frames);
51
51
-
}
52
38
};
53
39
54
40
pub const PartialSample = struct {
55
41
process: Process,
56
42
frames: []FrameWrapper,
57
57
-
58
58
-
fn deinit(self: *PartialSample, allocator: mem.Allocator) void {
59
59
-
for (self.frames) |frame| {
60
60
-
switch (frame) {
61
61
-
.invalid => {},
62
62
-
.call_stack => |stack| {
63
63
-
allocator.free(stack.module);
64
64
-
allocator.free(stack.function);
65
65
-
},
66
66
-
}
67
67
-
}
68
68
-
69
69
-
allocator.free(self.frames);
70
70
-
}
71
43
};
72
44
73
45
pub const SampleWrapper = union(enum) {
···
78
50
fn deinit(self: *SampleWrapper, allocator: mem.Allocator) void {
79
51
switch (self.*) {
80
52
.metric => {},
81
81
-
.full => |*sample| {
82
82
-
sample.deinit(allocator);
53
53
+
inline else => |*sample| {
54
54
+
for (sample.frames) |frame| {
55
55
+
switch (frame) {
56
56
+
.invalid => {},
57
57
+
.call_stack => |stack| {
58
58
+
allocator.free(stack.module);
59
59
+
allocator.free(stack.function);
60
60
+
},
61
61
+
}
62
62
+
}
63
63
+
allocator.free(sample.frames);
83
64
},
84
84
-
.partial => |*sample| sample.deinit(allocator),
85
65
}
86
66
}
87
67
};