Skip to content

Commit

Permalink
DString.copy: restore mem::heap() as default allocator
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Curto <[email protected]>
  • Loading branch information
pierrec committed Oct 5, 2023
1 parent f903600 commit b004b57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/std/core/dstring.c3
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b004b57

Please sign in to comment.