src/Platform-Posix.cpp
changeset 92 e3974e7360e9
parent 91 5f4402180204
child 251 ca99a81745fe
     1.1 --- a/src/Platform-Posix.cpp	Wed Jul 25 00:48:08 2012 -0700
     1.2 +++ b/src/Platform-Posix.cpp	Wed Jul 25 01:30:33 2012 -0700
     1.3 @@ -72,7 +72,7 @@
     1.4      }
     1.5  
     1.6      size_t requested = Min(amount * 2, amount + 2 * alignment);
     1.7 -    Address address = MapMemory(amount, mode, Prot_ReadWrite);
     1.8 +    Address address = MapMemory(requested, mode, Prot_ReadWrite);
     1.9      if (!address)
    1.10          return AlignableMapping();
    1.11  
    1.12 @@ -87,7 +87,7 @@
    1.13  
    1.14      if (requested - begin > amount) {
    1.15          // Shave off the last part of the unaligned region.
    1.16 -        UnmapAlignedMemory(address + amount, requested - amount - begin);
    1.17 +        UnmapAlignedMemory(aligned + amount, requested - amount - begin);
    1.18      }
    1.19  
    1.20      return AlignableMapping(aligned, alignment, amount);