Skip to content
  • Erik de Castro Lopo's avatar
    RtsUtils: Use `size_t` instead of `int` where appropriate · 0c0129b6
    Erik de Castro Lopo authored and Ben Gamari's avatar Ben Gamari committed
    Functions like `stgMallocBytes` take a size parameter which was of type
    `int`, but is commonly used as `stgMallocBytes (sizeof (...))`. This is
    problematic because the `sizeof` operator returns `size_t` so that on 64
    bit systems, in this common use case the `size_t` parameter would be
    truncated to 32 bits when passed to `stgMallocBytes` where it was cast
    back to `size_t`.
    
    Test Plan: Validate on Linux, OS X and Windows
    
    Reviewers: austin, hvr, bgamari, simonmar, hsyl20
    
    Reviewed By: hvr, bgamari, simonmar, hsyl20
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2201
    0c0129b6