From b004b57c6a5a3ab6f5d912502d6df313996785d8 Mon Sep 17 00:00:00 2001 From: Pierre Curto Date: Thu, 5 Oct 2023 07:56:16 +0200 Subject: [PATCH] DString.copy: restore mem::heap() as default allocator Signed-off-by: Pierre Curto --- lib/std/core/dstring.c3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/core/dstring.c3 b/lib/std/core/dstring.c3 index fbcfc0c45..3bb02a960 100644 --- a/lib/std/core/dstring.c3 +++ b/lib/std/core/dstring.c3 @@ -154,7 +154,7 @@ fn DString DString.copy(self, Allocator* using = null) return (DString)null; } StringData* data = self.data(); - if (!using) using = data.allocator; + if (!using) using = mem::heap(); DString new_string = new_with_capacity(data.capacity, using); mem::copy((char*)new_string.data(), (char*)data, StringData.sizeof + data.len); return new_string;