]>
Commit | Line | Data |
---|---|---|
329a2b87 JB |
1 | --- a/js/src/gc/Memory.cpp.orig 2013-11-13 01:13:53.000000000 +0100 |
2 | +++ a/js/src/gc/Memory.cpp 2013-11-28 05:03:31.160133711 +0100 | |
3 | @@ -63,7 +63,7 @@ | |
4 | p = VirtualAlloc(NULL, size * 2, MEM_RESERVE, PAGE_READWRITE); | |
5 | if (!p) | |
6 | return NULL; | |
7 | - void *chunkStart = (void *)(uintptr_t(p) + (alignment - (uintptr_t(p) % alignment))); | |
8 | + void *chunkStart = (void *)AlignBytes(uintptr_t(p), alignment); | |
9 | UnmapPages(rt, p, size * 2); | |
10 | p = VirtualAlloc(chunkStart, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); | |
11 | ||
12 | @@ -335,7 +335,7 @@ | |
13 | uintptr_t offset = uintptr_t(region) % alignment; | |
14 | JS_ASSERT(offset < reqSize - size); | |
15 | ||
16 | - void *front = (void *)(uintptr_t(region) + (alignment - offset)); | |
17 | + void *front = (void *)AlignBytes(uintptr_t(region), alignment); | |
18 | void *end = (void *)(uintptr_t(front) + size); | |
19 | if (front != region) | |
20 | JS_ALWAYS_TRUE(0 == munmap(region, alignment - offset)); |