Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 396275
Collapse All | Expand All

(-)file_not_specified_in_diff (-6 / +18 lines)
Line  Link Here
0
-- js/src/jsgcchunk.cpp        2011-12-22 17:13:21.000000000 +0000
0
++ js/src/jsgcchunk.cpp        2011-12-22 17:18:31.000000000 +0000
Lines 213-219 Link Here
213
#elif defined(XP_UNIX)
213
#elif defined(XP_UNIX)
214
214
215
/* Required on Solaris 10. Might improve performance elsewhere. */
215
/* Required on Solaris 10. Might improve performance elsewhere. */
216
# if defined(SOLARIS) && defined(MAP_ALIGN)
216
# if (defined(SOLARIS) && defined(MAP_ALIGN)) || defined(MOZ_MEMORY_LINUX) 
217
#  define JS_GC_HAS_MAP_ALIGN
217
#  define JS_GC_HAS_MAP_ALIGN
218
218
219
static void *
219
static void *
220
-- js/src/jsgcchunk.cpp        2011-12-22 17:55:24.000000000 +0000
220
++ js/src/jsgcchunk.cpp        2011-12-22 18:02:24.000000000 +0000
Lines 226-237 Link Here
226
#ifdef SOLARIS
226
#ifdef SOLARIS
227
    void *p = mmap((caddr_t) alignment, size, PROT_READ | PROT_WRITE,
227
    void *p = mmap((caddr_t) alignment, size, PROT_READ | PROT_WRITE,
228
                     MAP_PRIVATE | MAP_NOSYNC | MAP_ALIGN | MAP_ANON, -1, 0);
228
                     MAP_PRIVATE | MAP_NOSYNC | MAP_ALIGN | MAP_ANON, -1, 0);
229
    if (p == MAP_FAILED)
230
        return NULL;
229
#else
231
#else
230
    void *p = mmap((void *) alignment, size, PROT_READ | PROT_WRITE,
232
    void *p = mmap(NULL, size + alignment, PROT_READ | PROT_WRITE,
231
                     MAP_PRIVATE | MAP_NOSYNC | MAP_ALIGN | MAP_ANON, -1, 0);
233
                     MAP_PRIVATE | MAP_NOSYNC | MAP_ANON, -1, 0);
232
#endif
233
    if (p == MAP_FAILED)
234
    if (p == MAP_FAILED)
234
        return NULL;
235
        return NULL;
236
       uintptr_t aligned_ret;
237
       size_t extra_size;
238
239
       aligned_ret = (uintptr_t)p + alignment - 1;
240
       aligned_ret &= ~(alignment - 1);
241
       extra_size = aligned_ret - (uintptr_t)p;
242
       munmap(p, extra_size);
243
       munmap(p + extra_size + size, alignment - extra_size);
244
       p = (void *)aligned_ret;
245
#endif
246
235
    return p;
247
    return p;
236
}
248
}

Return to bug 396275