Branch: Tag:

2014-08-24

2014-08-24 12:37:20 by Arne Goedeke <el@laramies.com>

Strings: generate more static strings

quick_add_function and make_shared_string will now create
static strings when the argument is a compile time constant

819:    s = make_static_string(str, len, shift);    link_pike_string(s, h);    } else { +  +  if (!string_is_static(s)) { +  if (string_is_block_allocated(s)) { +  ba_free(&string_allocator, s->str); +  } else { +  free(s->str); +  } +  s->flags &= ~STRING_ALLOC_MASK; +  s->flags |= STRING_ALLOC_STATIC; +  s->str = str; +  } +     add_ref(s);    }