Skip to content

Commit

Permalink
chore: Correct _ARRAY_ITEM_SIZE capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
spotandjake committed Feb 2, 2025
1 parent 9c5a4f8 commit 80b9596
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion stdlib/runtime/unsafe/offsets.gr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ provide let _STR_DATA_OFFSET = 8n
// Array
provide let _ARRAY_LEN_OFFSET = 4n
provide let _ARRAY_DATA_OFFSET = 8n
provide let _Array_ITEM_SIZE = 4n
provide let _ARRAY_ITEM_SIZE = 4n

// Bytes
provide let _BYTES_LEN_OFFSET = 4n
Expand Down
4 changes: 2 additions & 2 deletions stdlib/runtime/unsafe/offsets.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ _ARRAY_LEN_OFFSET : WasmI32
_ARRAY_DATA_OFFSET : WasmI32
```

### Offsets.**_Array_ITEM_SIZE**
### Offsets.**_ARRAY_ITEM_SIZE**

```grain
_Array_ITEM_SIZE : WasmI32
_ARRAY_ITEM_SIZE : WasmI32
```

### Offsets.**_BYTES_LEN_OFFSET**
Expand Down
6 changes: 3 additions & 3 deletions stdlib/string.gr
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use Offsets.{
_STR_DATA_OFFSET,
_ARRAY_LEN_OFFSET,
_ARRAY_DATA_OFFSET,
_Array_ITEM_SIZE,
_ARRAY_ITEM_SIZE,
_BYTES_LEN_OFFSET,
_BYTES_DATA_OFFSET,
}
Expand Down Expand Up @@ -329,7 +329,7 @@ let explodeHelp = (s: String, chars) => {
}

WasmI32.store(arr + arrIdx, c, _ARRAY_DATA_OFFSET)
arrIdx += _Array_ITEM_SIZE
arrIdx += _ARRAY_ITEM_SIZE
ptr += n
}

Expand Down Expand Up @@ -478,7 +478,7 @@ provide let split = (separator: String, string: String) => {
let str = allocateString(strSize)
Memory.copy(str + _STR_DATA_OFFSET, last, strSize)
WasmI32.store(arr + _ARRAY_DATA_OFFSET, str, arrIdx)
arrIdx += _Array_ITEM_SIZE
arrIdx += _ARRAY_ITEM_SIZE
ptr += psize
last = ptr
continue
Expand Down

0 comments on commit 80b9596

Please sign in to comment.