pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:5501: Inside #if defined(PIKE_DEBUG) and #if defined(YYDEBUG)
   push_int(yydebug);    yydebug = yyd;   }      #endif /* YYDEBUG */   #endif      #if defined(HAVE_LOCALTIME) || defined(HAVE_GMTIME)   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);   }   #endif      #if defined (HAVE_GMTIME) || defined (HAVE_GMTIME_R) || defined (HAVE_GMTIME_S)   /*! @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
pike.git/src/builtin_functions.c:5564: Inside #if defined (HAVE_GMTIME) || defined (HAVE_GMTIME_R) || defined (HAVE_GMTIME_S)
  #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);   }   #endif      #ifdef HAVE_LOCALTIME   /*! @decl mapping(string:int) localtime(int timestamp)    *!    *! Convert seconds since 00:00:00 UTC, 1 Jan 1970 into components.    *!
pike.git/src/builtin_functions.c:5631: Inside #if defined(HAVE_LOCALTIME)
   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:5926: Inside #if defined (HAVE_MKTIME) || defined (HAVE_LOCALTIME)
   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:7507:   #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_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");    /* 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.    *    * The hblkhd value on proper implementations should be    * small enough not to affect the total much, so no need    * for a special case.    */    push_ulongest(mi.arena + mi.hblkhd);    -  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.smblks) {    /* NB: Kludge for dlmalloc: usmblks contains the max uordblks value. */    push_ulongest(mi.uordblks);    } else {    push_ulongest(mi.usmblks + mi.uordblks);    }    -  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");    push_ulongest(mi.fsmblks + mi.fordblks);      #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:9465:    INT_TYPE line;    struct pike_string *tmp = low_get_program_line(p, &line);       pop_n_elems(args);       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:9494:    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)    {    pop_n_elems(args);    if (line) {    push_string(file); -  push_text(":"); +  push_static_text(":");    push_int(line);    f_add(3);    }    else    push_string (file);    return;    }    pop_n_elems(args);    push_int(0);   }
pike.git/src/builtin_functions.c:9642:    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)    {    pop_n_elems(args);    if (line) {    push_string(file); -  push_text(":"); +  push_static_text(":");    push_int(line);    f_add(3);    }    else    push_string (file);    return;    }    }       pop_n_elems(args);