• Simon Marlow's avatar
    Improve accuracy of get/setAllocationCounter · a1a689dd
    Simon Marlow authored
    Summary:
    get/setAllocationCounter didn't take into account allocations in the
    current block. This was known at the time, but it turns out to be
    important to have more accuracy when using these in a fine-grained
    way.
    
    Test Plan:
    New unit test to test incrementally larger allocaitons.  Before I got
    results like this:
    
    ```
    +0
    +0
    +0
    +0
    +0
    +4096
    +0
    +0
    +0
    +0
    +0
    +4064
    +0
    +0
    +4088
    +4056
    +0
    +0
    +0
    +4088
    +4096
    +4056
    +4096
    ```
    
    Notice how the results aren't always monotonically increasing.  After
    this patch:
    
    ```
    +344
    +416
    +488
    +560
    +632
    +704
    +776
    +848
    +920
    +992
    +1064
    +1136
    +1208
    +1280
    +1352
    +1424
    +1496
    +1568
    +1640
    +1712
    +1784
    +1856
    +1928
    +2000
    +2072
    +2144
    ```
    
    Reviewers: niteria, bgamari, hvr, erikd
    
    Subscribers: rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4288
    a1a689dd
alloccounter1.hs 425 Bytes