ast_gen::ast_gen(model & m, schedule & s, const options & opt): m_model(m), m_model_summary(m), m_schedule(s), m_options(opt), m_printer(m.context), m_order(compute_order()) { }
void memory::allocators::BuddyAllocator::put(pblk_t blk) { if (blk.size == 0) { return; } if (reinterpret_cast<size_t>(blk.ptr) & ((1 << 12) - 1)) { lib::cout << __func__ << ": bad page address: " << blk.ptr << lib::endl; panic(__func__); } ++stats.deallocations; while(blk.size) { size_t block_order = compute_order(blk); if (reinterpret_cast<size_t>(blk.ptr) & ((1 << 12) - 1)) { panic("bad page addr in while!"); } page_frame_t *squashed_pages = free_list_[block_order].put(blk.ptr); if (squashed_pages) { size_t putting_list = block_order + 1; while ((squashed_pages = free_list_[putting_list].put( squashed_pages))) { ++putting_list; } } size_t block_size = 1 << block_order; blk.size -= block_size; blk.ptr += block_size; } }
void test_rank1_select1() { compute_order(one_bits); for (uint64_t i = 0; i < one_bits; i++) assert(rrr->rank1(rrr->select1(order[i])) == rank1[select1[order[i]]]); }