Skip to content

Commit 53b991b

Browse files
committed
deprecate BumpAllocator's threadSafeAllocator - use std.heap.ThreadSafeAllocator instead.
1 parent 199c343 commit 53b991b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/std/heap/BumpAllocator.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub fn init(buffer: []u8) @This() {
1616
};
1717
}
1818

19-
/// Using this at the same time as the interface returned by `threadSafeAllocator` is not thread safe.
2019
pub fn allocator(self: *@This()) Allocator {
2120
return .{
2221
.ptr = self,
@@ -31,6 +30,7 @@ pub fn allocator(self: *@This()) Allocator {
3130

3231
/// Provides a lock free thread safe `Allocator` interface to the underlying `FixedBufferAllocator`
3332
/// Using this at the same time as the interface returned by `allocator` is not thread safe.
33+
/// Deprecated; to be removed after 0.16.0 is tagged.
3434
pub fn threadSafeAllocator(self: *@This()) Allocator {
3535
return .{
3636
.ptr = self,
@@ -155,6 +155,7 @@ pub fn free(
155155
assert(alloc_base <= @intFromPtr(self.bump));
156156
}
157157

158+
/// Deprecated; to be removed after 0.16.0 is tagged.
158159
fn threadSafeAlloc(
159160
ctx: *anyopaque,
160161
length: usize,
@@ -249,6 +250,7 @@ test "works at comptime for alignments <= 1" {
249250
}
250251
}
251252

253+
// Deprecated; to be removed after 0.16.0 is tagged.
252254
test "thread safe version" {
253255
var buffer: [1 << 20]u8 = undefined;
254256
var bump_allocator: @This() = .init(&buffer);

0 commit comments

Comments
 (0)