summaryrefslogtreecommitdiff
path: root/src/c_heap.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/c_heap.zig')
-rw-r--r--src/c_heap.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/c_heap.zig b/src/c_heap.zig
index efd2064d..51cfc137 100644
--- a/src/c_heap.zig
+++ b/src/c_heap.zig
@@ -103,6 +103,11 @@ pub fn Heap(comptime current: *const std.mem.Allocator) type {
var test_allocator: std.mem.Allocator = undefined;
+/// Never written, as a release session's zstd heap's allocator was: a
+/// constant to the compiler, `ptr` (undefined in std's stateless
+/// allocators) whatever it likes at each comparison.
+var stateless: std.mem.Allocator = std.heap.page_allocator;
+
test "a C heap block keeps its bytes, frees exactly, and goes back where it came from" {
const heap = Heap(&test_allocator);
test_allocator = std.testing.allocator;
@@ -141,11 +146,6 @@ test "a C heap block keeps its bytes, frees exactly, and goes back where it came
heap.free(null);
}
-/// Never written, as a release session's zstd heap's allocator was: a
-/// constant to the compiler, `ptr` (undefined in std's stateless
-/// allocators) whatever it likes at each comparison.
-var stateless: std.mem.Allocator = std.heap.page_allocator;
-
test "a heap over a stateless allocator that is never repointed names it once" {
const heap = Heap(&stateless);
const before = allocators_len.load(.monotonic);