mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Fix use of GEP (was using byte offset, not index)
This commit is contained in:
parent
4182e51877
commit
cc8683d241
7 changed files with 48 additions and 33 deletions
|
@ -143,10 +143,12 @@ impl<'a> Builtin<'a> {
|
|||
pub const SET_WORDS: u32 = Builtin::MAP_WORDS; // Set is an alias for Map with {} for value
|
||||
pub const LIST_WORDS: u32 = 2;
|
||||
|
||||
/// Layout of collection wrapper - a struct of (pointer, length, capacity)
|
||||
/// Layout of collection wrapper for List and Str - a struct of (pointre, length).
|
||||
///
|
||||
/// We choose this layout (with pointer first) because it's how
|
||||
/// Rust slices are laid out, meaning we can cast to/from them for free.
|
||||
pub const WRAPPER_PTR: u32 = 0;
|
||||
pub const WRAPPER_LEN: u32 = 1;
|
||||
pub const WRAPPER_CAPACITY: u32 = 2;
|
||||
|
||||
pub fn stack_size(&self, pointer_size: u32) -> u32 {
|
||||
use Builtin::*;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue