File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -175,10 +175,11 @@ inline fn copyRange4(
175
175
const last = len - copy_len ;
176
176
const pen = last - b ;
177
177
178
- dest [0.. copy_len ].* = src [0.. copy_len ].* ;
179
- dest [b .. ][0.. copy_len ].* = src [b .. ][0.. copy_len ].* ;
180
- dest [pen .. ][0.. copy_len ].* = src [pen .. ][0.. copy_len ].* ;
181
- dest [last .. ][0.. copy_len ].* = src [last .. ][0.. copy_len ].* ;
178
+ const Int = @Type (.{ .int = .{ .signedness = .unsigned , .bits = copy_len * 8 } });
179
+ @as (* align (1 ) Int , @ptrCast (dest [0.. copy_len ])).* = @as (* align (1 ) const Int , @ptrCast (src [0.. copy_len ])).* ;
180
+ @as (* align (1 ) Int , @ptrCast (dest [b .. ][0.. copy_len ])).* = @as (* align (1 ) const Int , @ptrCast (src [b .. ][0.. copy_len ])).* ;
181
+ @as (* align (1 ) Int , @ptrCast (dest [pen .. ][0.. copy_len ])).* = @as (* align (1 ) const Int , @ptrCast (src [pen .. ][0.. copy_len ])).* ;
182
+ @as (* align (1 ) Int , @ptrCast (dest [last .. ][0.. copy_len ])).* = @as (* align (1 ) const Int , @ptrCast (src [last .. ][0.. copy_len ])).* ;
182
183
}
183
184
184
185
test "memcpy" {
You can’t perform that action at this time.
0 commit comments