Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.

Update string.(lift|lower)_memory to read u32 + string.size #102

Closed
wants to merge 1 commit into from

Commits on Mar 27, 2020

  1. Update string.(lift|lower)_memory to read u32 + string.size

    Initially, `string.lift_memory` reads a pair of `i32` to represent the pointer/the base, and the length of the string. `string.lower_memory` also reads a `i32` to represent the pointer/the base. Finally, `string.size` returns a `i32`.
    
    This patch proposes to change `i32` by `u32`. Indeed, a pointer/a base cannot be negative, so it can be represented by `u32`. The length of the string can also not be negative, so it is by definition a `u32`.
    
    In addition, using `i32` restricts ourself to a memory of 2Gib, whilst `u32` allows to address a memory of 4Gib.
    Hywan authored Mar 27, 2020
    Configuration menu
    Copy the full SHA
    e287a42 View commit details
    Browse the repository at this point in the history