fix roc_std to support seamless str slices

This commit is contained in:
Brendan Hansknecht 2023-03-14 15:06:17 -07:00
parent 3978059aa2
commit 18e6dbd163
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
2 changed files with 17 additions and 10 deletions

View file

@ -698,6 +698,11 @@ impl From<SendSafeRocStr> for RocStr {
#[repr(C)]
union RocStrInner {
// TODO: this really should be separated from the List type.
// Due to length specifying seamless slices for Str and capacity for Lists they should not share the same code.
// Currently, there are work arounds in RocList to handle both via removing the highest bit of length in many cases.
// With glue changes, we should probably rewrite these cleanly to match what is in the zig bitcode.
// It is definitely a bit stale now and I think the storage mechanism can be quite confusing with our extra pieces of state.
heap_allocated: ManuallyDrop<RocList<u8>>,
small_string: SmallString,
}