Branch: Tag:

2014-08-22

2014-08-22 19:59:05 by Arne Goedeke <el@laramies.com>

Strings: added and used push_static_text

Use the new static string allocation support where possible. This is the
case all code which is not dynamically loaded.

5508: Inside #if defined(HAVE_LOCALTIME) || defined(HAVE_GMTIME)
  #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
5571:    pop_n_elems(args);    encode_struct_tm(tm);    -  push_text("timezone"); +  push_static_text("timezone");    push_int(0);    f_aggregate_mapping(20);   }
5638: Inside #if defined(HAVE_LOCALTIME)
   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)
5933: Inside #if defined (HAVE_MKTIME) || defined (HAVE_LOCALTIME)
   {    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--;
7514: Inside #if defined(HAVE_MALLINFO) || defined(USE_DL_MALLOC)
     #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
7528: Inside #if defined(HAVE_MALLINFO) || defined(USE_DL_MALLOC)
   */    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);
7538: Inside #if defined(HAVE_MALLINFO) || defined(USE_DL_MALLOC)
   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); \
9472:    push_string(tmp);    if(line >= 1)    { -  push_text(":"); +  push_static_text(":");    push_int(line);    f_add(3);    }
9501:    pop_n_elems(args);    if (line) {    push_string(file); -  push_text(":"); +  push_static_text(":");    push_int(line);    f_add(3);    }
9649:    pop_n_elems(args);    if (line) {    push_string(file); -  push_text(":"); +  push_static_text(":");    push_int(line);    f_add(3);    }