Commit 14dd8e7d authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #306 from toshok/fix-spectral-norm-gc-regression

remove the larger buckets, and hoist some math out of loops.
parents 01b8b9b7 a9426101
......@@ -359,8 +359,8 @@ SmallArena::Block** SmallArena::_freeChain(Block** head) {
int first_obj = b->minObjIndex();
int atoms_per_obj = b->atomsPerObj();
for (int obj_idx = first_obj; obj_idx < num_objects; obj_idx++) {
int atom_idx = obj_idx * atoms_per_obj;
for (int atom_idx = first_obj * atoms_per_obj; atom_idx < num_objects * atoms_per_obj;
atom_idx += atoms_per_obj) {
if (b->isfree.isSet(atom_idx))
continue;
......@@ -507,8 +507,8 @@ void SmallArena::_getChainStatistics(HeapStatistics* stats, Block** head) {
int first_obj = b->minObjIndex();
int atoms_per_obj = b->atomsPerObj();
for (int obj_idx = first_obj; obj_idx < num_objects; obj_idx++) {
int atom_idx = obj_idx * atoms_per_obj;
for (int atom_idx = first_obj * atoms_per_obj; atom_idx < num_objects * atoms_per_obj;
atom_idx += atoms_per_obj) {
if (b->isfree.isSet(atom_idx))
continue;
......
......@@ -102,8 +102,8 @@ constexpr uintptr_t HUGE_ARENA_START = 0x3270000000L;
// bitmap for objects of a given size (constant for the block)
//
static const size_t sizes[] = {
16, 32, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384,
448, 512, 640, 768, 896, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584, // 4096,
16, 32, 48, 64, 80, 96, 112, 128, 160, 192,
224, 256, 320, 384, 448, 512, 640, 768, 896, 1024 //, 1280, 1536, 1792, 2048, 2560, 3072, 3584, // 4096,
};
static constexpr size_t NUM_BUCKETS = sizeof(sizes) / sizeof(sizes[0]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment