354 // I'm declaring them as ints. I'm not anticipating heap region |
354 // I'm declaring them as ints. I'm not anticipating heap region |
355 // sizes to reach anywhere near 2g, so using an int here is safe. |
355 // sizes to reach anywhere near 2g, so using an int here is safe. |
356 static int GrainBytes; |
356 static int GrainBytes; |
357 static int GrainWords; |
357 static int GrainWords; |
358 static int CardsPerRegion; |
358 static int CardsPerRegion; |
|
359 |
|
360 static size_t align_up_to_region_byte_size(size_t sz) { |
|
361 return (sz + (size_t) GrainBytes - 1) & |
|
362 ~((1 << (size_t) LogOfHRGrainBytes) - 1); |
|
363 } |
359 |
364 |
360 // It sets up the heap region size (GrainBytes / GrainWords), as |
365 // It sets up the heap region size (GrainBytes / GrainWords), as |
361 // well as other related fields that are based on the heap region |
366 // well as other related fields that are based on the heap region |
362 // size (LogOfHRGrainBytes / LogOfHRGrainWords / |
367 // size (LogOfHRGrainBytes / LogOfHRGrainWords / |
363 // CardsPerRegion). All those fields are considered constant |
368 // CardsPerRegion). All those fields are considered constant |