Skip to content

Commit 41a07b0

Browse files
authored
Merge pull request #54 from alexcrichton/update-alignment
Change utf16+latin1 to always use alignment of 2
2 parents c890d92 + cc35c09 commit 41a07b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

design/mvp/CanonicalABI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ bytes):
585585
```python
586586
def store_string_to_latin1_or_utf16(opts, src, src_code_units):
587587
assert(src_code_units <= MAX_STRING_BYTE_LENGTH)
588-
ptr = opts.realloc(0, 0, 1, src_code_units)
588+
ptr = opts.realloc(0, 0, 2, src_code_units)
589589
dst_byte_length = 0
590590
for usv in src:
591591
if ord(usv) < (1 << 8):
@@ -605,7 +605,7 @@ def store_string_to_latin1_or_utf16(opts, src, src_code_units):
605605
tagged_code_units = int(len(encoded) / 2) | UTF16_TAG
606606
return (ptr, tagged_code_units)
607607
if dst_byte_length < src_code_units:
608-
ptr = opts.realloc(ptr, src_code_units, 1, dst_byte_length)
608+
ptr = opts.realloc(ptr, src_code_units, 2, dst_byte_length)
609609
return (ptr, dst_byte_length)
610610
```
611611

0 commit comments

Comments
 (0)