Bug #17652 » ruby-cygwin-rb_aligned_malloc.patch
gc.c | ||
---|---|---|
} rb_objspace_t;
|
||
/* default tiny heap size: 16KB */
|
||
/* default tiny heap size: 64KB for Cygwin, 16KB otherwise */
|
||
#if defined __CYGWIN__
|
||
#define HEAP_PAGE_ALIGN_LOG 16
|
||
#else
|
||
#define HEAP_PAGE_ALIGN_LOG 14
|
||
#endif
|
||
#define CEILDIV(i, mod) (((i) + (mod) - 1)/(mod))
|
||
enum {
|
||
HEAP_PAGE_ALIGN = (1UL << HEAP_PAGE_ALIGN_LOG),
|
||
... | ... | |
}
|
||
char *aligned = ptr + alignment;
|
||
aligned -= ((VALUE)aligned & (alignment - 1));
|
||
GC_ASSERT(aligned > ptr);
|
||
GC_ASSERT(aligned <= ptr + alignment);
|
||
aligned -= (((VALUE)aligned - 1) & (alignment - 1)) + 1;
|
||
GC_ASSERT(aligned >= ptr);
|
||
GC_ASSERT(aligned < ptr + alignment);
|
||
size_t start_out_of_range_size = aligned - ptr;
|
||
GC_ASSERT(start_out_of_range_size % sysconf(_SC_PAGE_SIZE) == 0);
|
- « Previous
- 1
- 2
- Next »