pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:5710:       {    int i;    for (i = -args + 1; i < 0; i++) {    struct svalue *s = Pike_sp + i;       if (TYPEOF(*s) == T_INT)    continue;       else if (!REFCOUNTED_TYPE(TYPEOF(*s))) { -  free (mc_work_queue + 1); +  mc_work_queue++; /* Compensate for 1-based indexing. */ +  free(mc_work_queue);    mc_work_queue = NULL;    stop_mc();    SIMPLE_ARG_TYPE_ERROR (    "count_memory", i + args + 1,    "array|multiset|mapping|object|program|string|type|int");    }       else {    if (TYPEOF(*s) == T_FUNCTION) {    struct svalue s2;    if (!(s2.u.program = program_from_function (s))) { -  free (mc_work_queue + 1); +  mc_work_queue++; /* Compensate for 1-based indexing. */ +  free(mc_work_queue);    mc_work_queue = NULL;    stop_mc();    SIMPLE_ARG_TYPE_ERROR (    "count_memory", i + args + 1,    "array|multiset|mapping|object|program|string|type|int");    }    add_ref (s2.u.program);    SET_SVAL_TYPE(s2, T_PROGRAM);    free_svalue (s);    move_svalue (s, &s2);
pike.git/src/gc.c:5746:    /* The user passed the same thing several times. Ignore it. */    }       else {    struct mc_marker *m =    my_make_mc_marker (s->u.ptr, visit_fn_from_type[TYPEOF(*s)], NULL);    m->flags |= MC_FLAG_INTERNAL;    if (!mc_block_pike_cycle_depth && TYPEOF(*s) == T_OBJECT) {    int cycle_depth = mc_cycle_depth_from_obj (s->u.object);    if (TYPEOF(throw_value) != PIKE_T_FREE) { -  free (mc_work_queue + 1); +  mc_work_queue++; /* Compensate for 1-based indexing. */ +  free(mc_work_queue);    mc_work_queue = NULL;    stop_mc();    throw_severity = THROW_ERROR;    pike_throw();    }    m->la_count = cycle_depth >= 0 ? cycle_depth : mc_lookahead;    }    else    m->la_count = mc_lookahead;    mc_wq_enqueue (m);
pike.git/src/gc.c:5875:    MC_DEBUG_MSG (NULL, "leave - added to incomplete list");    }    else {    DL_ADD_LAST (mc_complete, mc_ref_from);    MC_DEBUG_MSG (NULL, "leave - added to complete list");    }    }    }       if (TYPEOF(throw_value) != PIKE_T_FREE) { -  free (mc_work_queue + 1); +  mc_work_queue++; /* Compensate for 1-based indexing. */ +  free(mc_work_queue);    mc_work_queue = NULL;    stop_mc();    throw_severity = THROW_ERROR;    pike_throw();    }    }   #if defined (PIKE_DEBUG) || defined (MEMORY_COUNT_DEBUG)    mc_ref_from = (void *) (ptrdiff_t) -1;   #endif   
pike.git/src/gc.c:6280:    if (mc_ref_from->flags & MC_FLAG_INT_VISITED) continue;       mc_ref_from->flags |= MC_FLAG_INT_VISITED;    mc_ref_from->visit_fn(mc_ref_from->thing, VISIT_COMPLEX_ONLY, NULL);    }      #if defined (PIKE_DEBUG) || defined (MEMORY_COUNT_DEBUG)    mc_ref_from = (void *) (ptrdiff_t) -1;   #endif    -  /* NB: 1-based indexing in mc_work_queue. */ -  mc_work_queue++; +  mc_work_queue++; /* Compensate for 1-based indexing. */    free(mc_work_queue);    mc_work_queue = NULL;       visit_enter = NULL;    visit_ref = NULL;    visit_leave = NULL;      #ifdef PIKE_DEBUG    if (s != Pike_sp-1) {    Pike_fatal("Stack error in identify_loops.\n");