msgc_context_t *msgc_begin( gc_t *gc ) { caddr_t lowest, highest; int doublewords; msgc_context_t *context; context = must_malloc( sizeof( msgc_context_t ) ); context->gc = gc; gclib_memory_range( &lowest, &highest ); context->lowest_heap_address = (word*)lowest; context->highest_heap_address = (word*)highest; doublewords = roundup(highest-lowest,(2*sizeof(word)))/(2*sizeof(word)); context->words_in_bitmap = roundup(doublewords,(8*sizeof(word)))/(8*sizeof(word)); context->bitmap = gclib_alloc_rts( context->words_in_bitmap * sizeof(word), 0 ); memset( context->bitmap, 0, context->words_in_bitmap*sizeof(word) ); context->stack.seg = 0; context->stack.stkp = 0; context->stack.stkbot = 0; context->stack.stklim = 0; push_segment( &context->stack ); context->los_stack.seg = 0; context->los_stack.stkp = 0; context->los_stack.stkbot = 0; context->los_stack.stklim = 0; push_segment( &context->los_stack ); return context; }
static void LOS_PUSH( msgc_context_t *context, word next, word obj ) { assert2_address_mapped( context, obj ); if ((context)->los_stack.stkp == (context)->los_stack.stklim) push_segment( &context->los_stack ); *((context)->los_stack.stkp++) = next; *((context)->los_stack.stkp++) = obj; }
void Stack<E, F>::push(E item) { assert(!is_full(), "pushing onto a full stack"); if (this->_cur_seg_size == this->_seg_size) { push_segment(); } this->_cur_seg[this->_cur_seg_size] = item; ++this->_cur_seg_size; }
void Stack<E>::push(E item) { assert(!is_full(), "pushing onto a full stack"); if (_cur_seg_size == _seg_size) { push_segment(); } _cur_seg[_cur_seg_size] = item; ++_cur_seg_size; }
msgc_context_t *msgc_begin_range( gc_t *gc, caddr_t lowest, caddr_t highest ) { int doublewords; msgc_context_t *context; context = must_malloc( sizeof( msgc_context_t ) ); context->gc = gc; context->lowest_heap_address = (word*)lowest; context->highest_heap_address = (word*)highest; doublewords = roundup(highest-lowest,(2*sizeof(word)))/(2*sizeof(word)); context->words_in_bitmap = roundup(doublewords,(8*sizeof(word)))/(8*sizeof(word)); context->bitmap = gclib_alloc_rts( context->words_in_bitmap * sizeof(word), 0 ); context->object_visitor = NULL; context->object_visitor_data = NULL; context->stop_when = NULL; context->stop_when_data = NULL; context->signal_stop = FALSE; context->stopped_on_obj = 0x0; context->stopped_on_src = 0x0; memset( context->bitmap, 0, context->words_in_bitmap*sizeof(word) ); context->stack.seg = 0; context->stack.stkp = 0; context->stack.stkbot = 0; context->stack.stklim = 0; push_segment( &context->stack ); context->los_stack.seg = 0; context->los_stack.stkp = 0; context->los_stack.stkbot = 0; context->los_stack.stklim = 0; push_segment( &context->los_stack ); return context; }
static void PUSH( msgc_context_t *context, word obj, word src, int word_offset ) { word TMP = obj; assert((word_offset < 0) || (ptrof(src)[word_offset] == obj)); assert2_basic_invs( context, src, obj ); if ((context)->object_visitor != NULL) { (context)->object_visitor_data = (context)->object_visitor ( obj, src, word_offset*sizeof(word), (context)->object_visitor_data ); } if (((context)->stop_when != NULL) && !((context)->signal_stop)) { if ((context)->stop_when(obj, src, (context)->stop_when_data)) { (context)->signal_stop = TRUE; (context)->stopped_on_obj = obj; (context)->stopped_on_src = src; } } if (isptr(TMP)) { if ((context)->stack.stkp == (context)->stack.stklim) push_segment( &((context)->stack) ); *((context)->stack.stkp++) = TMP; } }