mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
fix bugs from recent changes and additions
This commit is contained in:
parent
c1b8f468d7
commit
ce29c7e92f
2 changed files with 3 additions and 1 deletions
|
@ -511,6 +511,7 @@ pub fn listReleaseExcessCapacity(
|
|||
|
||||
@memcpy(dest_ptr, source_ptr, old_length * element_width);
|
||||
}
|
||||
list.decref(alignment);
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1989,6 +1989,7 @@ pub fn isValidUnicode(buf: []const u8) bool {
|
|||
|
||||
while (buf[i] >= 0b1000_0000) {
|
||||
// This forces prefetching, otherwise the loop can run at about half speed.
|
||||
if (i + 4 >= buf.len) break;
|
||||
var small_buf: [4]u8 = undefined;
|
||||
@memcpy(&small_buf, @ptrCast([*]const u8, buf) + i, 4);
|
||||
// TODO: Should we always inline these function calls below?
|
||||
|
@ -1997,7 +1998,6 @@ pub fn isValidUnicode(buf: []const u8) bool {
|
|||
return false;
|
||||
}
|
||||
i += cp_len;
|
||||
if (i + 4 >= buf.len) break;
|
||||
} else |_| {
|
||||
return false;
|
||||
}
|
||||
|
@ -2927,6 +2927,7 @@ pub fn strReleaseExcessCapacity(
|
|||
const dest_ptr = output.asU8ptrMut();
|
||||
|
||||
@memcpy(dest_ptr, source_ptr, old_length);
|
||||
string.decref();
|
||||
|
||||
return output;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue