diff --git a/vm/code_blocks.cpp b/vm/code_blocks.cpp index 4e1944b792..9610205797 100755 --- a/vm/code_blocks.cpp +++ b/vm/code_blocks.cpp @@ -440,7 +440,7 @@ code_block *factor_vm::add_code_block(code_block_type type, cell code_, cell lab method returns, except when compiling words with the non-optimizing compiler at the beginning of bootstrap */ this->code->uninitialized_blocks.insert(std::make_pair(compiled,literals.value())); - this->code->all_blocks.insert(compiled); + this->code->all_blocks.insert((cell)compiled); /* next time we do a minor GC, we have to trace this code block, since the fields of the code_block struct might point into nursery or aging */ diff --git a/vm/code_heap.cpp b/vm/code_heap.cpp index 4060b17cee..12f903f66a 100755 --- a/vm/code_heap.cpp +++ b/vm/code_heap.cpp @@ -63,7 +63,7 @@ void code_heap::free(code_block *compiled) FACTOR_ASSERT(!uninitialized_p(compiled)); points_to_nursery.erase(compiled); points_to_aging.erase(compiled); - all_blocks.erase(compiled); + all_blocks.erase((cell)compiled); allocator->free(compiled); } @@ -98,14 +98,13 @@ void code_heap::sweep() } struct all_blocks_set_verifier { - std::set *all_blocks; + std::set *all_blocks; - all_blocks_set_verifier(std::set *all_blocks) : all_blocks(all_blocks) {} + all_blocks_set_verifier(std::set *all_blocks) : all_blocks(all_blocks) {} void operator()(code_block *block, cell size) { - FACTOR_ASSERT(all_blocks->find(block) != all_blocks->end()); - all_blocks->erase(block); + FACTOR_ASSERT(all_blocks->find((cell)block) != all_blocks->end()); } }; @@ -117,11 +116,11 @@ void code_heap::verify_all_blocks_set() code_block *code_heap::code_block_for_address(cell address) { - std::set::const_iterator blocki = + std::set::const_iterator blocki = all_blocks.upper_bound((code_block*)address); FACTOR_ASSERT(blocki != all_blocks.begin()); --blocki; - code_block* found_block = *blocki; + code_block* found_block = (code_block*)*blocki; #ifdef FACTOR_DEBUG if (!((cell)found_block->entry_point() <= address && address - (cell)found_block->entry_point() < found_block->size())) @@ -146,7 +145,7 @@ struct all_blocks_set_inserter { void operator()(code_block *block, cell size) { - code->all_blocks.insert(block); + code->all_blocks.insert((cell)block); } }; diff --git a/vm/code_heap.hpp b/vm/code_heap.hpp index 83b3ae586d..a7bf9284f3 100755 --- a/vm/code_heap.hpp +++ b/vm/code_heap.hpp @@ -20,7 +20,7 @@ struct code_heap { /* Memory allocator */ free_list_allocator *allocator; - std::set all_blocks; + std::set all_blocks; /* Keys are blocks which need to be initialized by initialize_code_block(). Values are literal tables. Literal table arrays are GC roots until the