mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Add env.small_str_bytes
This commit is contained in:
parent
8322006e36
commit
254b93a8ce
2 changed files with 5 additions and 1 deletions
|
@ -94,6 +94,10 @@ impl<'a, 'ctx, 'env> Env<'a, 'ctx, 'env> {
|
||||||
pub fn ptr_int(&self) -> IntType<'ctx> {
|
pub fn ptr_int(&self) -> IntType<'ctx> {
|
||||||
ptr_int(self.context, self.ptr_bytes)
|
ptr_int(self.context, self.ptr_bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn small_str_bytes(&self) -> u32 {
|
||||||
|
self.ptr_bytes * 2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn module_from_builtins<'ctx>(ctx: &'ctx Context, module_name: &str) -> Module<'ctx> {
|
pub fn module_from_builtins<'ctx>(ctx: &'ctx Context, module_name: &str) -> Module<'ctx> {
|
||||||
|
|
|
@ -401,7 +401,7 @@ where
|
||||||
byte_array_ptr,
|
byte_array_ptr,
|
||||||
&[ctx
|
&[ctx
|
||||||
.i8_type()
|
.i8_type()
|
||||||
.const_int(((env.ptr_bytes * 2) - 1) as u64, false)],
|
.const_int(env.small_str_bytes() as u64 - 1, false)],
|
||||||
"final_byte_ptr",
|
"final_byte_ptr",
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue