- TICK_GC_WORDS_COPIED(size);
- /* Find out where we're going, using the handy "to" pointer in
- * the step of the source object. If it turns out we need to
- * evacuate to an older generation, adjust it here (see comment
- * by evacuate()).
- */
- if (stp->gen_no < evac_gen) {
- if (eager_promotion) {
- stp = &generations[evac_gen].steps[0];
- } else {
- failed_to_evac = rtsTrue;
- }
- }
-
- /* chain a new block onto the to-space for the destination step if
- * necessary.
- */
- if (stp->scavd_hp + size >= stp->scavd_hpLim) {
- gc_alloc_scavd_block(stp);
- }
-
- to = stp->scavd_hp;
- from = (StgPtr)src;
- stp->scavd_hp = to + size;
- for (i = 0; i < size; i++) { // unroll for small i
- to[i] = from[i];
- }
-
- /* retag pointer before updating EVACUATE closure and returning */
- to = (StgPtr)TAG_CLOSURE(tag,(StgClosure*)to);