ecma_stringbuilder_create_from (ecma_string_t *string_p) /**< ecma string */
{
  const lit_utf8_size_t string_size = ecma_string_get_size (string_p);
  const lit_utf8_size_t initial_size = string_size + ECMA_ASCII_STRING_HEADER_SIZE;

  ecma_stringbuilder_header_t *header_p = (ecma_stringbuilder_header_t *) jmem_heap_alloc_block (initial_size);
  header_p->current_size = initial_size;
#if JERRY_MEM_STATS
  jmem_stats_allocate_string_bytes (initial_size);
#endif /* JERRY_MEM_STATS */

  size_t copied_size = ecma_string_copy_to_cesu8_buffer (string_p,
                                                         ECMA_STRINGBUILDER_STRING_PTR (header_p),
                                                         string_size);
  JERRY_ASSERT (copied_size == string_size);

  ecma_stringbuilder_t ret = {.header_p = header_p};
  return ret;
} /* ecma_stringbuilder_create_from */
ecma_stringbuilder_create_from (ecma_string_t *string_p)  
{
  const lit_utf8_size_t string_size = ecma_string_get_size (string_p);
  const lit_utf8_size_t initial_size = string_size + ECMA_ASCII_STRING_HEADER_SIZE;

  ecma_stringbuilder_header_t *header_p = (ecma_stringbuilder_header_t *) jmem_heap_alloc_block (initial_size);
  header_p->current_size = initial_size;
#if JERRY_MEM_STATS
  jmem_stats_allocate_string_bytes (initial_size);
#endif  

  size_t copied_size = ecma_string_copy_to_cesu8_buffer (string_p,
                                                         ECMA_STRINGBUILDER_STRING_PTR (header_p),
                                                         string_size);
  JERRY_ASSERT (copied_size == string_size);

  ecma_stringbuilder_t ret = {.header_p = header_p};
  return ret;
}  