Skip to content

Commit

Permalink
Fix binned_allocator self params
Browse files Browse the repository at this point in the history
Co-authored-by: Ian Johnson <[email protected]>
  • Loading branch information
SuperAuguste and ianprime0509 authored Nov 21, 2023
1 parent 5a266ed commit bdc762a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/binned_allocator.zig
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ pub fn BinnedAllocator(comptime config: Config) type {
fn init() @This() {
return .{ .count = std.atomic.Atomic(usize).init(0) };
}
fn load(self: @This()) usize {
fn load(self: *const @This()) usize {
return self.count.load(.Acquire);
}
fn increment(self: @This()) void {
fn increment(self: *@This()) void {
_ = self.count.fetchAdd(1, .AcqRel);
}
fn decrement(self: @This()) void {
fn decrement(self: *@This()) void {
_ = self.count.fetchSub(1, .AcqRel);
}
}
Expand All @@ -156,10 +156,10 @@ pub fn BinnedAllocator(comptime config: Config) type {
fn load(self: @This()) usize {
return self.count;
}
fn increment(self: @This()) void {
fn increment(self: *@This()) void {
self.count += 1;
}
fn decrement(self: @This()) void {
fn decrement(self: *@This()) void {
self.count -= 1;
}
};
Expand Down

0 comments on commit bdc762a

Please sign in to comment.