mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-23 08:48:03 +00:00
Fix copyToPtrAs docs
This commit is contained in:
parent
e2e9bd0907
commit
4882ea30fe
1 changed files with 7 additions and 1 deletions
|
|
@ -142,7 +142,13 @@ pub fn copyToPtr(self: StackValue, layout_cache: *LayoutStore, dest_ptr: *anyopa
|
|||
@memcpy(dst, src);
|
||||
}
|
||||
|
||||
/// Copy this value into a destination pointer, using the destination layout to choose representation when needed
|
||||
/// Copy this value into a destination pointer, using the destination layout to choose representation.
|
||||
///
|
||||
/// This exists because we still have a few places (notably tag-union payloads and
|
||||
/// closure capture records) where the pointer supplied by the caller is less
|
||||
/// aligned than the source layout would like. Until we fix those layout gaps we
|
||||
/// perform byte copies here instead of going through `copyToPtr`, which would
|
||||
/// attempt an `@alignCast` and panic.
|
||||
pub fn copyToPtrAs(self: StackValue, layout_cache: *LayoutStore, dest_ptr: *anyopaque, dest_layout: Layout, ops: *RocOps) !void {
|
||||
std.debug.assert(self.is_initialized);
|
||||
if (self.ptr == null) return error.NullStackPointer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue