From b232c6477b332ed38c5a1d3e7a4cb76faebb216f Mon Sep 17 00:00:00 2001 From: Johan Engelen Date: Mon, 1 Apr 2024 14:54:59 +0200 Subject: [PATCH] Fix alignment of buffers in kernighan_ritchie unittests. --- .../allocator/building_blocks/kernighan_ritchie.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/std/experimental/allocator/building_blocks/kernighan_ritchie.d b/std/experimental/allocator/building_blocks/kernighan_ritchie.d index 6883d33adae..167cf1bc6bc 100644 --- a/std/experimental/allocator/building_blocks/kernighan_ritchie.d +++ b/std/experimental/allocator/building_blocks/kernighan_ritchie.d @@ -647,7 +647,7 @@ fronting the GC allocator. import std.experimental.allocator.gc_allocator : GCAllocator; import std.typecons : Ternary; // KRRegion fronting a general-purpose allocator - ubyte[1024 * 128] buf; + align(KRRegion!().alignment) ubyte[1024 * 128] buf; auto alloc = fallbackAllocator(KRRegion!()(buf), GCAllocator.instance); auto b = alloc.allocate(100); assert(b.length == 100); @@ -916,7 +916,7 @@ version (StdUnittest) @system unittest { import std.typecons : Ternary; - ubyte[1024] b; + align(KRRegion!().alignment) ubyte[1024] b; auto alloc = KRRegion!()(b); auto k = alloc.allocate(128);