pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:1138:    if(TYPEOF(Pike_sp[1-args]) != T_STRING)    SIMPLE_ARG_TYPE_ERROR("has_prefix", 2, "string");       b = Pike_sp[1-args].u.string;       if (TYPEOF(Pike_sp[-args]) == T_OBJECT) {    ptrdiff_t i;    struct object *o = Pike_sp[-args].u.object;    int inherit_no = SUBTYPEOF(Pike_sp[-args]);    +  if (!o->prog || FIND_LFUN(o->prog, LFUN__SIZEOF) < 0) { +  Pike_error("has_prefix(): Object in argument 1 lacks lfun::_sizeof().\n"); +  } +     apply_lfun(o, LFUN__SIZEOF, 0);    if ((TYPEOF(Pike_sp[-1]) != T_INT) || (Pike_sp[-1].u.integer < b->len)) {    pop_n_elems(args + 1);    push_int(0);    return;    }       for (i = 0; i < b->len; i++) {    p_wchar2 ch = index_shared_string(b, i);    Pike_sp[-1].u.integer = i;
pike.git/src/builtin_functions.c:7477:    size_t num,size;    struct svalue *ss;   #ifdef USE_DL_MALLOC    struct mallinfo mi = dlmallinfo();   #elif HAVE_MALLINFO    struct mallinfo mi = mallinfo();   #endif    pop_n_elems(args);    ss=Pike_sp;    +  /* TODO: If USE_DL_MALLOC is defined then this will report the +  * statistics from our bundled Doug Lea malloc, and not the +  * underlying system malloc. Ideally we should include both. */ +    #if defined(HAVE_MALLINFO) || defined(USE_DL_MALLOC)       push_text("num_malloc_blocks");    push_ulongest(1 + mi.hblks); /* 1 for the arena. */    push_text("malloc_block_bytes");    /* NB: Kludge for glibc: hblkhd is intended for malloc overhead    * according to the Solaris manpages, but glibc keeps the    * amount of mmapped memory there, and uses the arena only    * for the amount from sbrk.    *