pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:5377:    do_debug(); /* Calls do_gc() since d_flag > 3. */   #else    do_gc(NULL, 1);   #endif    d_flag=tmp;    pop_n_elems(args);   }      static void encode_struct_tm(struct tm *tm)   { -  push_text("sec"); +  push_static_text("sec");    push_int(tm->tm_sec); -  push_text("min"); +  push_static_text("min");    push_int(tm->tm_min); -  push_text("hour"); +  push_static_text("hour");    push_int(tm->tm_hour);    -  push_text("mday"); +  push_static_text("mday");    push_int(tm->tm_mday); -  push_text("mon"); +  push_static_text("mon");    push_int(tm->tm_mon); -  push_text("year"); +  push_static_text("year");    push_int(tm->tm_year);    -  push_text("wday"); +  push_static_text("wday");    push_int(tm->tm_wday); -  push_text("yday"); +  push_static_text("yday");    push_int(tm->tm_yday); -  push_text("isdst"); +  push_static_text("isdst");    push_int(tm->tm_isdst);   }      /*! @decl mapping(string:int) gmtime(int timestamp)    *!    *! Convert seconds since 00:00:00 UTC, Jan 1, 1970 into components.    *!    *! This function works like @[localtime()] but the result is    *! not adjusted for the local time zone.    *!
pike.git/src/builtin_functions.c:5438:   #elif defined (HAVE_GMTIME_S)    if (!gmtime_s (&tm_s, &t)) tm = &tm_s; else tm = NULL;   #else    tm = gmtime(&t);   #endif    if (!tm) Pike_error ("gmtime() on this system cannot handle "    "the timestamp %"PRINTLONGEST"d.\n", (LONGEST) t);    pop_n_elems(args);    encode_struct_tm(tm);    -  push_text("timezone"); +  push_static_text("timezone");    push_int(0);    f_aggregate_mapping(20);   }      /*! @decl mapping(string:int) localtime(int timestamp)    *!    *! Convert seconds since 00:00:00 UTC, 1 Jan 1970 into components.    *!    *! @returns    *! This function returns a mapping with the following components:
pike.git/src/builtin_functions.c:5503:    SIMPLE_ARG_ERROR ("localtime", 1, "Timestamp outside valid range.");   #endif    t = (time_t) tt;       tm = localtime(&t);    if (!tm) Pike_error ("localtime() on this system cannot handle "    "the timestamp %ld.\n", (long) t);    pop_n_elems(args);    encode_struct_tm(tm);    -  push_text("timezone"); +  push_static_text("timezone");   #ifdef STRUCT_TM_HAS_GMTOFF    push_int(-tm->tm_gmtoff);   #elif defined(STRUCT_TM_HAS___TM_GMTOFF)    push_int(-tm->__tm_gmtoff);   #elif defined(HAVE_EXTERNAL_TIMEZONE)    /* Assume dst is one hour. */    push_int(timezone - 3600*tm->tm_isdst);   #else    /* Assume dst is one hour. */    push_int(-3600*tm->tm_isdst);
pike.git/src/builtin_functions.c:5793:    struct tm date;    time_t retval;       if (args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("mktime", 1);       if(args == 1)    {    memset(&date, 0, sizeof(date));    -  push_text("sec"); -  push_text("min"); -  push_text("hour"); -  push_text("mday"); -  push_text("mon"); -  push_text("year"); -  push_text("isdst"); -  push_text("timezone"); +  push_static_text("sec"); +  push_static_text("min"); +  push_static_text("hour"); +  push_static_text("mday"); +  push_static_text("mon"); +  push_static_text("year"); +  push_static_text("isdst"); +  push_static_text("timezone");    f_aggregate(8);    f_rows(2);    Pike_sp--;    dmalloc_touch_svalue(Pike_sp);    push_array_items(Pike_sp->u.array);       args=8;    }       get_all_args("mktime",args, "%i%i%i%i%i%i.%i%i",
pike.git/src/builtin_functions.c:7286:       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_static_text("num_malloc_blocks");    push_ulongest(1 + mi.hblks); /* 1 for the arena. */ -  push_text("malloc_block_bytes"); +  push_static_text("malloc_block_bytes");    if (mi.arena < 0) {    /* Kludge for broken Linux libc, where the fields are ints.    *    * 31-bit overflow, so perform an unsigned read.    */    size = (unsigned int)mi.arena;    } else {    /* On Solaris the fields are unsigned long (and may thus be 64-bit). */    size = mi.arena;    }
pike.git/src/builtin_functions.c:7315: Inside #if defined(HAVE_MALLINFO) || defined(USE_DL_MALLOC)
   * small enough not to affect the total much, so no need    * for a special case.    */    if (mi.hblkhd < 0) {    size += (unsigned int)mi.hblkhd;    } else {    size += mi.hblkhd;    }    push_ulongest(size);    -  push_text("num_malloc"); +  push_static_text("num_malloc");    push_ulongest(mi.ordblks + mi.smblks); -  push_text("malloc_bytes"); +  push_static_text("malloc_bytes");    if (mi.uordblks < 0) {    size = (unsigned int)mi.uordblks;    } else {    size = mi.uordblks;    }    if (mi.smblks) {    /* NB: Not dlmalloc where usmblks contains the max uordblks value. */    if (mi.usmblks < 0) {    size += (unsigned int)mi.usmblks;    } else {    size += mi.usmblks;    }    }    push_ulongest(size);    -  push_text("num_free_blocks"); +  push_static_text("num_free_blocks");    push_int(1); -  push_text("free_block_bytes"); +  push_static_text("free_block_bytes");    if (mi.fsmblks < 0) {    size = (unsigned int)mi.fsmblks;    } else {    size = mi.fsmblks;    }    if (mi.fordblks < 0) {    size += (unsigned int)mi.fordblks;    } else {    size += mi.fordblks;    }    push_ulongest(size);      #endif      #define COUNT(TYPE) do { \    PIKE_CONCAT3(count_memory_in_, TYPE, s)(&num, &size); \ -  push_text("num_" #TYPE "s"); \ +  push_static_text("num_" #TYPE "s"); \    push_ulongest(num); \    push_text(#TYPE "_bytes"); \    push_ulongest(size); \    } while(0)       COUNT(array);    COUNT(ba_mixed_frame);    COUNT(callable);    COUNT(callback);    COUNT(catch_context);
pike.git/src/builtin_functions.c:8976:    if( (offset = find_shared_string_identifier( ident, p )) == -1 )    {    INT_TYPE line;    struct pike_string *tmp = low_get_program_line(p, &line);       if (tmp)    {    push_string(tmp);    if(line >= 1)    { -  push_text(":"); +  push_static_text(":");    push_int(line);    f_add(3);    }    }    else    push_int(0);    return;    }       id = ID_FROM_INT(p, offset);
pike.git/src/builtin_functions.c:9004:    (p2 = program_from_svalue (&id_prog->constants[id->func.const_info.offset].sval)))    file = low_get_program_line (p2, &line);    else    /* The program line is better than nothing for C functions. */    file = low_get_program_line (p, &line);       if (file)    {    if (line) {    push_string(file); -  push_text(":"); +  push_static_text(":");    push_int(line);    f_add(3);    }    else    push_string (file);    return;    }       push_int(0);   }
pike.git/src/builtin_functions.c:9151:    (p2 = program_from_svalue (&id_prog->constants[id->func.const_info.offset].sval)))    file = low_get_program_line (p2, &line);    else    /* The program line is better than nothing for C functions. */    file = low_get_program_line (p, &line);       if (file)    {    if (line) {    push_string(file); -  push_text(":"); +  push_static_text(":");    push_int(line);    f_add(3);    }    else    push_string (file);    return;    }    }       push_int(0);