pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:1032:   }      void debug_gc_fatal_2 (void *a, int type, int flags, const char *fmt, ...)   {    va_list args;    va_start (args, fmt);    debug_gc_fatal_va (a, type, flags, fmt, args);    va_end (args);   }    - static void dloc_gc_fatal (const char *file, int line, + static void dloc_gc_fatal (const char *file, INT_TYPE line,    void *a, int flags, const char *fmt, ...)   {    va_list args; -  fprintf (stderr, "%s:%d: GC fatal:\n", file, line); +  fprintf (stderr, "%s:%ld: GC fatal:\n", file, (long)line);    va_start (args, fmt);    debug_gc_fatal_va (a, PIKE_T_UNKNOWN, flags, fmt, args);    va_end (args);   }      static void rec_stack_fatal (struct gc_rec_frame *err, const char *err_name,    struct gc_rec_frame *p1, const char *p1n,    struct gc_rec_frame *p2, const char *p2n, -  const char *file, int line, +  const char *file, INT_TYPE line,    const char *fmt, ...)   {    va_list args;    va_start (args, fmt);    fprintf (stderr, msg_fatal_error, file, line);    (void) VFPRINTF (stderr, fmt, args);   #if defined (PIKE_DEBUG) || defined (GC_CYCLE_DEBUG)    fputs ("Recursion stack:\n", stderr);    describe_rec_stack (err, err_name, p1, p1n, p2, p2n);    if (err) {
pike.git/src/gc.c:1172: Inside #if defined(PIKE_DEBUG)
   }       if (p == pike_trampoline_program && ((struct object *) a)->refs > 0) {    /* Special hack to get something useful out of trampolines.    * Ought to have an event hook for this sort of thing. */    struct pike_trampoline *t =    (struct pike_trampoline *) ((struct object *) a)->storage;    struct object *o = t->frame->current_object;    struct program *p = o->prog;    struct identifier *id; -  INT32 line; +  INT_TYPE line;    struct pike_string *file;       fprintf (stderr, "%*s**The object is a trampoline.\n", indent, "");       if (!p) {    fprintf (stderr, "%*s**The trampoline function's object "    "is destructed.\n", indent, "");    p = id_to_program (o->program_id);    }   
pike.git/src/gc.c:1299: Inside #if defined(PIKE_DEBUG)
   fprintf (stderr, "%*s**Object got a parent.\n", indent, "");    }else{    fprintf(stderr,"%*s**There is no parent (any longer?)\n",indent,"");    }    }    break;       case T_PROGRAM:    {    char *tmp; -  INT32 line; +  INT_TYPE line;    ptrdiff_t id_idx, id_count = 0;    struct inherit *inh = p->inherits, *next_inh = p->inherits + 1;    ptrdiff_t inh_id_end = p->num_identifier_references;       fprintf(stderr,"%*s**Program id: %ld, flags: %x, parent id: %d\n",    indent,"", (long)(p->id), p->flags,    p->parent ? p->parent->id : -1);       if(p->flags & PROGRAM_HAS_C_METHODS)    {
pike.git/src/gc.c:1548:    }       case T_PIKE_FRAME: {    struct pike_frame *f = (struct pike_frame *) a;    do {    if (f->refs <= 0) break;    if (f->current_object) {    struct program *p = f->current_object->prog;    if (p) {    struct identifier *id = ID_FROM_INT(p, f->fun); -  INT32 line; +  INT_TYPE line;    struct pike_string *file;    if (IDENTIFIER_IS_PIKE_FUNCTION(id->identifier_flags) &&    id->func.offset >= 0 &&    (file = get_line(p->program + id->func.offset, p, &line))) {    fprintf(stderr, "%*s**Function %s at %s:%ld\n",    indent, "", id->name->str, file->str, (long) line);    free_string(file);    }    else    fprintf(stderr, "%*s**Function %s at unknown location.\n",
pike.git/src/gc.c:2038: Inside #if defined(PIKE_DEBUG)
   if (gc_is_watching) {    fprintf(stderr, "## Exiting gc and resetting watches for %d things.\n",    gc_is_watching);    gc_is_watching = 0;    }   #endif   }      #ifdef PIKE_DEBUG    - PMOD_EXPORT void gc_check_zapped (void *a, TYPE_T type, const char *file, int line) + PMOD_EXPORT void gc_check_zapped (void *a, TYPE_T type, const char *file, INT_TYPE line)   {    struct marker *m = find_marker (a);    if (m && (m->flags & GC_CLEANUP_LEAKED)) -  fprintf (stderr, "Free of leaked %s %p from %s:%d, %d refs remaining\n", -  get_name_of_type (type), a, file, line, *(INT32 *)a - 1); +  fprintf (stderr, "Free of leaked %s %p from %s:%ld, %d refs remaining\n", +  get_name_of_type (type), a, file, (long)line, *(INT32 *)a - 1);   }      /* This function marks some known externals. The rest are handled by    * callbacks added with add_gc_callback. */   static void mark_externals (void)   {    struct mapping *constants;    if (master_object)    gc_mark_external (master_object, " as master_object");    if ((constants = get_builtin_constants()))
pike.git/src/gc.c:2248:    fprintf (stderr, "Cycle id frame %p is freed. It is: ", f->cycle_id); \    describe_rec_frame (f->cycle_id); \    fputc ('\n', stderr); \    dloc_gc_fatal (file, line, f->data, 0, "Cycle id frame is freed.\n"); \    } \    } while (0)      static void check_rec_stack_frame (struct gc_rec_frame *f,    struct gc_rec_frame *p1, const char *p1n,    struct gc_rec_frame *p2, const char *p2n, -  const char *file, int line) +  const char *file, INT_TYPE line)   {    /* To allow this function to be used after a stack rotation but    * before cycle_id markup, there are no checks here for cycle_id    * consistency wrt other frames on the rec stack. */    LOW_CHECK_REC_FRAME (f, file, line);    if (f->rf_flags & (GC_ON_CYCLE_PIECE_LIST|GC_ON_KILL_LIST))    rec_stack_fatal (f, "err", p1, p1n, p2, p2n, file, line,    "Frame %p is not on the rec stack (according to flags).\n",    f);    if (!f->prev)
pike.git/src/gc.c:2295:    f->cycle_piece->u.last_cycle_piece,    f->cycle_piece->u.last_cycle_piece ?    f->cycle_piece->u.last_cycle_piece->cycle_piece : NULL,    f->cycle_piece, f);   }   #define CHECK_REC_STACK_FRAME(f) \    do check_rec_stack_frame ((f), NULL, NULL, NULL, NULL, __FILE__, __LINE__); \    while (0)      static void check_cycle_piece_frame (struct gc_rec_frame *f, -  const char *file, int line) +  const char *file, INT_TYPE line)   {    LOW_CHECK_REC_FRAME (f, file, line);    if ((f->rf_flags & (GC_ON_CYCLE_PIECE_LIST|GC_ON_KILL_LIST)) !=    GC_ON_CYCLE_PIECE_LIST)    dloc_gc_fatal (file, line, f->data, 0,    "Frame is not on a cycle piece list "    "(according to flags).\n");    if (f->prev)    dloc_gc_fatal (file, line, f->data, 0,    "Prev pointer set for frame on cycle piece list.\n");   }   #define CHECK_CYCLE_PIECE_FRAME(f) \    do check_cycle_piece_frame ((f), __FILE__, __LINE__); while (0)      static void check_kill_list_frame (struct gc_rec_frame *f, -  const char *file, int line) +  const char *file, INT_TYPE line)   {    LOW_CHECK_REC_FRAME (f, file, line);    if ((f->rf_flags & (GC_ON_CYCLE_PIECE_LIST|GC_ON_KILL_LIST)) !=    GC_ON_KILL_LIST)    dloc_gc_fatal (file, line, f->data, 0,    "Frame is not on kill list (according to flags).\n");    if (f->prev)    dloc_gc_fatal (file, line, f->data, 0,    "Prev pointer set for frame on kill list.\n");   }
pike.git/src/gc.c:3808: Inside #if defined(PIKE_DEBUG)
   if (o->prog && (o->prog->flags & PROGRAM_USES_PARENT) &&    PARENT_INFO(o)->parent &&    !PARENT_INFO(o)->parent->prog &&    get_marker(PARENT_INFO(o)->parent)->flags & GC_LIVE_OBJ)    gc_fatal(o, 0, "GC destructed parent prematurely.\n");   #endif       GC_VERBOSE_DO(    fprintf(stderr, "| Killing %p with %d refs", o, o->refs);    if (o->prog) { -  INT32 line; +  INT_TYPE line;    struct pike_string *file = get_program_line (o->prog, &line);    fprintf(stderr, ", prog %s:%d\n", file->str, line);    free_string(file);    }    else fputs(", is destructed\n", stderr);    );       destruct_object (o, reason);    free_object(o);    gc_free_extra_ref(o);
pike.git/src/gc.c:4798:   {    struct program *p = o->prog;    struct svalue val;       if (!p) return 0; /* No need to look ahead in destructed objects. */       object_index_no_free2 (&val, o, 0, &pike_cycle_depth_str);       if (TYPEOF(val) != T_INT) {    int i = find_shared_string_identifier (pike_cycle_depth_str.u.string, p); -  INT32 line; +  INT_TYPE line;    struct pike_string *file = get_identifier_line (p, i, &line); -  make_error ("Object got non-integer pike_cycle_depth %O at %S:%d.\n", -  &val, file, line); +  make_error ("Object got non-integer pike_cycle_depth %O at %S:%ld.\n", +  &val, file, (long)line);    free_svalue (&val);    free_svalue (&throw_value);    move_svalue (&throw_value, --Pike_sp);    return -1;    }       if (SUBTYPEOF(val) == NUMBER_UNDEFINED)    return -1;       if (val.u.integer > (unsigned INT16) -1)    return (unsigned INT16) -1;       if (val.u.integer < 0) {    int i = find_shared_string_identifier (pike_cycle_depth_str.u.string, p); -  INT32 line; +  INT_TYPE line;    struct pike_string *file = get_identifier_line (p, i, &line); -  make_error ("Object got negative pike_cycle_depth at %S:%d.\n", -  &val, file, line); +  make_error ("Object got negative pike_cycle_depth at %S:%ld.\n", +  &val, file, (long)line);    free_svalue (&throw_value);    move_svalue (&throw_value, --Pike_sp);    return -1;    }       return val.u.integer;   }      static void pass_lookahead_visit_ref (void *thing, int ref_type,    visit_thing_fn *visit_fn, void *extra)