Change 'mem' namspace to 'jmem'

The 'mem_' prefix is too general, so it might clash with
symbols in other libraries. Renamed the directory, file,
funtion and type names.

Related issue: #1052

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó
2016-05-13 14:09:31 +02:00
parent aaa3d22677
commit 92bb551d45
63 changed files with 1612 additions and 1612 deletions
@@ -1237,7 +1237,7 @@ ecma_builtin_array_prototype_object_sort (ecma_value_t this_arg, /**< this argum
}
}
MEM_DEFINE_LOCAL_ARRAY (values_buffer, defined_prop_count, ecma_value_t);
JMEM_DEFINE_LOCAL_ARRAY (values_buffer, defined_prop_count, ecma_value_t);
ecma_collection_iterator_init (&iter, array_index_props_p);
@@ -1296,7 +1296,7 @@ ecma_builtin_array_prototype_object_sort (ecma_value_t this_arg, /**< this argum
ecma_free_value (values_buffer[index]);
}
MEM_FINALIZE_LOCAL_ARRAY (values_buffer);
JMEM_FINALIZE_LOCAL_ARRAY (values_buffer);
/* Undefined properties should be in the back of the array. */
@@ -139,7 +139,7 @@ ecma_builtin_error_prototype_object_to_string (ecma_value_t this_arg) /**< this
const lit_utf8_size_t space_size = lit_get_magic_string_size (LIT_MAGIC_STRING_SPACE_CHAR);
const lit_utf8_size_t size = name_size + msg_size + colon_size + space_size;
MEM_DEFINE_LOCAL_ARRAY (ret_str_buffer, size, lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (ret_str_buffer, size, lit_utf8_byte_t);
lit_utf8_byte_t *ret_str_buffer_p = ret_str_buffer;
lit_utf8_size_t bytes = ecma_string_to_utf8_string (name_string_p, ret_str_buffer_p, name_size);
@@ -165,7 +165,7 @@ ecma_builtin_error_prototype_object_to_string (ecma_value_t this_arg) /**< this
ret_str_p = ecma_new_ecma_string_from_utf8 (ret_str_buffer,
size);
MEM_FINALIZE_LOCAL_ARRAY (ret_str_buffer);
JMEM_FINALIZE_LOCAL_ARRAY (ret_str_buffer);
}
ret_value = ecma_make_string_value (ret_str_p);
@@ -125,7 +125,7 @@ ecma_builtin_function_prototype_object_apply (ecma_value_t this_arg, /**< this a
const uint32_t length = ecma_number_to_uint32 (length_number);
/* 6. */
MEM_DEFINE_LOCAL_ARRAY (arguments_list_p, length, ecma_value_t);
JMEM_DEFINE_LOCAL_ARRAY (arguments_list_p, length, ecma_value_t);
uint32_t last_index = 0;
/* 7. */
@@ -160,7 +160,7 @@ ecma_builtin_function_prototype_object_apply (ecma_value_t this_arg, /**< this a
ecma_free_value (arguments_list_p[index]);
}
MEM_FINALIZE_LOCAL_ARRAY (arguments_list_p);
JMEM_FINALIZE_LOCAL_ARRAY (arguments_list_p);
ECMA_OP_TO_NUMBER_FINALIZE (length_number);
ECMA_FINALIZE (length_value);
@@ -81,9 +81,9 @@ ecma_builtin_global_object_print (ecma_value_t this_arg __attr_unused___, /**< t
lit_utf8_size_t utf8_str_size = ecma_string_get_size (str_p);
MEM_DEFINE_LOCAL_ARRAY (utf8_str_p,
utf8_str_size,
lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (utf8_str_p,
utf8_str_size,
lit_utf8_byte_t);
lit_utf8_size_t actual_sz = ecma_string_to_utf8_string (str_p, utf8_str_p, utf8_str_size);
JERRY_ASSERT (actual_sz == utf8_str_size);
@@ -124,7 +124,7 @@ ecma_builtin_global_object_print (ecma_value_t this_arg __attr_unused___, /**< t
printf (" ");
}
MEM_FINALIZE_LOCAL_ARRAY (utf8_str_p);
JMEM_FINALIZE_LOCAL_ARRAY (utf8_str_p);
ECMA_FINALIZE (str_value);
}
@@ -735,9 +735,9 @@ ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri __attr_unused___,
ecma_string_t *input_string_p = ecma_get_string_from_value (string);
lit_utf8_size_t input_size = ecma_string_get_size (input_string_p);
MEM_DEFINE_LOCAL_ARRAY (input_start_p,
input_size + 1,
lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (input_start_p,
input_size + 1,
lit_utf8_byte_t);
lit_utf8_size_t sz = ecma_string_to_utf8_string (input_string_p,
input_start_p,
@@ -807,7 +807,7 @@ ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri __attr_unused___,
if (ecma_is_value_empty (ret_value))
{
MEM_DEFINE_LOCAL_ARRAY (output_start_p,
JMEM_DEFINE_LOCAL_ARRAY (output_start_p,
output_size,
lit_utf8_byte_t);
@@ -934,10 +934,10 @@ ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri __attr_unused___,
}
}
MEM_FINALIZE_LOCAL_ARRAY (output_start_p);
JMEM_FINALIZE_LOCAL_ARRAY (output_start_p);
}
MEM_FINALIZE_LOCAL_ARRAY (input_start_p);
JMEM_FINALIZE_LOCAL_ARRAY (input_start_p);
ECMA_FINALIZE (string);
return ret_value;
@@ -1013,9 +1013,9 @@ ecma_builtin_global_object_encode_uri_helper (ecma_value_t uri, /**< uri argumen
ecma_string_t *input_string_p = ecma_get_string_from_value (string);
lit_utf8_size_t input_size = ecma_string_get_size (input_string_p);
MEM_DEFINE_LOCAL_ARRAY (input_start_p,
input_size,
lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (input_start_p,
input_size,
lit_utf8_byte_t);
lit_utf8_size_t sz = ecma_string_to_utf8_string (input_string_p,
input_start_p,
@@ -1092,9 +1092,9 @@ ecma_builtin_global_object_encode_uri_helper (ecma_value_t uri, /**< uri argumen
if (ecma_is_value_empty (ret_value))
{
MEM_DEFINE_LOCAL_ARRAY (output_start_p,
output_length,
lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (output_start_p,
output_length,
lit_utf8_byte_t);
lit_utf8_byte_t *output_char_p = output_start_p;
input_char_p = input_start_p;
@@ -1147,10 +1147,10 @@ ecma_builtin_global_object_encode_uri_helper (ecma_value_t uri, /**< uri argumen
ret_value = ecma_make_string_value (output_string_p);
MEM_FINALIZE_LOCAL_ARRAY (output_start_p);
JMEM_FINALIZE_LOCAL_ARRAY (output_start_p);
}
MEM_FINALIZE_LOCAL_ARRAY (input_start_p);
JMEM_FINALIZE_LOCAL_ARRAY (input_start_p);
ECMA_FINALIZE (string);
return ret_value;
@@ -1234,9 +1234,9 @@ ecma_builtin_global_object_escape (ecma_value_t this_arg __attr_unused___, /**<
ecma_string_t *input_string_p = ecma_get_string_from_value (string);
lit_utf8_size_t input_size = ecma_string_get_size (input_string_p);
MEM_DEFINE_LOCAL_ARRAY (input_start_p,
input_size,
lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (input_start_p,
input_size,
lit_utf8_byte_t);
lit_utf8_size_t sz = ecma_string_to_utf8_string (input_string_p,
input_start_p,
@@ -1276,9 +1276,9 @@ ecma_builtin_global_object_escape (ecma_value_t this_arg __attr_unused___, /**<
}
}
MEM_DEFINE_LOCAL_ARRAY (output_start_p,
output_length,
lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (output_start_p,
output_length,
lit_utf8_byte_t);
lit_utf8_byte_t *output_char_p = output_start_p;
@@ -1327,9 +1327,9 @@ ecma_builtin_global_object_escape (ecma_value_t this_arg __attr_unused___, /**<
ret_value = ecma_make_string_value (output_string_p);
MEM_FINALIZE_LOCAL_ARRAY (output_start_p);
JMEM_FINALIZE_LOCAL_ARRAY (output_start_p);
MEM_FINALIZE_LOCAL_ARRAY (input_start_p);
JMEM_FINALIZE_LOCAL_ARRAY (input_start_p);
ECMA_FINALIZE (string);
return ret_value;
@@ -1357,7 +1357,7 @@ ecma_builtin_global_object_unescape (ecma_value_t this_arg __attr_unused___, /**
lit_utf8_size_t input_size = ecma_string_get_size (input_string_p);
/* 3. */
MEM_DEFINE_LOCAL_ARRAY (input_start_p, input_size, lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (input_start_p, input_size, lit_utf8_byte_t);
lit_utf8_size_t sz = ecma_string_to_utf8_string (input_string_p, input_start_p, input_size);
JERRY_ASSERT (sz == input_size);
@@ -1426,7 +1426,7 @@ ecma_builtin_global_object_unescape (ecma_value_t this_arg __attr_unused___, /**
ecma_string_t *output_string_p = ecma_new_ecma_string_from_utf8 (input_start_p, output_length);
ret_value = ecma_make_string_value (output_string_p);
MEM_FINALIZE_LOCAL_ARRAY (input_start_p);
JMEM_FINALIZE_LOCAL_ARRAY (input_start_p);
ECMA_FINALIZE (string);
return ret_value;
@@ -272,7 +272,7 @@ ecma_builtin_helper_json_create_hex_digit_ecma_string (uint8_t value) /**< value
/* 2.c.iii */
ecma_string_t *hex_str_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
MEM_DEFINE_LOCAL_ARRAY (hex_buff, 4, lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (hex_buff, 4, lit_utf8_byte_t);
for (uint32_t i = 0; i < 4; i++)
{
@@ -297,7 +297,7 @@ ecma_builtin_helper_json_create_hex_digit_ecma_string (uint8_t value) /**< value
ecma_deref_ecma_string (hex_str_p);
hex_str_p = ecma_new_ecma_string_from_utf8 ((lit_utf8_byte_t *) hex_buff, 4);
MEM_FINALIZE_LOCAL_ARRAY (hex_buff);
JMEM_FINALIZE_LOCAL_ARRAY (hex_buff);
JERRY_ASSERT (ecma_string_get_length (hex_str_p));
@@ -85,7 +85,7 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg
'Null' or one of possible object's classes.
The string with null character is maximum 19 characters long. */
const lit_utf8_size_t buffer_size = 19;
MEM_DEFINE_LOCAL_ARRAY (str_buffer, buffer_size, lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (str_buffer, buffer_size, lit_utf8_byte_t);
lit_utf8_byte_t *buffer_ptr = str_buffer;
@@ -107,7 +107,7 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg
ret_string_p = ecma_new_ecma_string_from_utf8 (str_buffer, (lit_utf8_size_t) (buffer_ptr - str_buffer));
MEM_FINALIZE_LOCAL_ARRAY (str_buffer);
JMEM_FINALIZE_LOCAL_ARRAY (str_buffer);
return ecma_make_string_value (ret_string_p);
} /* ecma_builtin_helper_object_to_string */
@@ -961,7 +961,7 @@ ecma_builtin_json_stringify (ecma_value_t this_arg __attr_unused___, /**< 'this'
}
else
{
MEM_DEFINE_LOCAL_ARRAY (space_buff, space, char);
JMEM_DEFINE_LOCAL_ARRAY (space_buff, space, char);
for (int32_t i = 0; i < space; i++)
{
@@ -970,7 +970,7 @@ ecma_builtin_json_stringify (ecma_value_t this_arg __attr_unused___, /**< 'this'
context.gap_str_p = ecma_new_ecma_string_from_utf8 ((lit_utf8_byte_t *) space_buff, (lit_utf8_size_t) space);
MEM_FINALIZE_LOCAL_ARRAY (space_buff);
JMEM_FINALIZE_LOCAL_ARRAY (space_buff);
}
ECMA_OP_TO_NUMBER_FINALIZE (array_length_num);
@@ -196,7 +196,7 @@ ecma_builtin_number_prototype_object_to_string (ecma_value_t this_arg, /**< this
should_round = true;
}
MEM_DEFINE_LOCAL_ARRAY (buff, buff_size, lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (buff, buff_size, lit_utf8_byte_t);
int buff_index = 0;
/* Calculate digits for whole part. */
@@ -310,7 +310,7 @@ ecma_builtin_number_prototype_object_to_string (ecma_value_t this_arg, /**< this
JERRY_ASSERT (buff_index <= buff_size);
ecma_string_t *str_p = ecma_new_ecma_string_from_utf8 (buff, (lit_utf8_size_t) buff_index);
ret_value = ecma_make_string_value (str_p);
MEM_FINALIZE_LOCAL_ARRAY (buff);
JMEM_FINALIZE_LOCAL_ARRAY (buff);
}
ECMA_OP_TO_NUMBER_FINALIZE (arg_num);
}
@@ -463,7 +463,7 @@ ecma_builtin_number_prototype_object_to_fixed (ecma_value_t this_arg, /**< this
}
JERRY_ASSERT (buffer_size > 0);
MEM_DEFINE_LOCAL_ARRAY (buff, buffer_size, lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (buff, buffer_size, lit_utf8_byte_t);
lit_utf8_byte_t *p = buff;
@@ -559,7 +559,7 @@ ecma_builtin_number_prototype_object_to_fixed (ecma_value_t this_arg, /**< this
ecma_string_t *str = ecma_new_ecma_string_from_utf8 (buff, (lit_utf8_size_t) (p - buff));
ret_value = ecma_make_string_value (str);
MEM_FINALIZE_LOCAL_ARRAY (buff);
JMEM_FINALIZE_LOCAL_ARRAY (buff);
}
}
}
@@ -666,7 +666,7 @@ ecma_builtin_number_prototype_object_to_exponential (ecma_value_t this_arg, /**<
buffer_size++;
}
MEM_DEFINE_LOCAL_ARRAY (buff, buffer_size, lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (buff, buffer_size, lit_utf8_byte_t);
int digit = 0;
uint64_t scale = 1;
@@ -745,7 +745,7 @@ ecma_builtin_number_prototype_object_to_exponential (ecma_value_t this_arg, /**<
*actual_char_p = '\0';
ecma_string_t *str = ecma_new_ecma_string_from_utf8 (buff, (lit_utf8_size_t) (actual_char_p - buff));
ret_value = ecma_make_string_value (str);
MEM_FINALIZE_LOCAL_ARRAY (buff);
JMEM_FINALIZE_LOCAL_ARRAY (buff);
}
}
}
@@ -862,7 +862,7 @@ ecma_builtin_number_prototype_object_to_precision (ecma_value_t this_arg, /**< t
buffer_size++;
}
MEM_DEFINE_LOCAL_ARRAY (buff, buffer_size, lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (buff, buffer_size, lit_utf8_byte_t);
lit_utf8_byte_t *actual_char_p = buff;
uint64_t scale = 1;
@@ -978,7 +978,7 @@ ecma_builtin_number_prototype_object_to_precision (ecma_value_t this_arg, /**< t
ecma_string_t *str_p = ecma_new_ecma_string_from_utf8 (buff, (lit_utf8_size_t) (actual_char_p - buff));
ret_value = ecma_make_string_value (str_p);
MEM_FINALIZE_LOCAL_ARRAY (buff);
JMEM_FINALIZE_LOCAL_ARRAY (buff);
}
}
ECMA_OP_TO_NUMBER_FINALIZE (arg_num);
@@ -705,7 +705,7 @@ ecma_builtin_object_object_define_properties (ecma_value_t this_arg __attr_unuse
ecma_collection_iterator_init (&iter, prop_names_p);
// 4.
MEM_DEFINE_LOCAL_ARRAY (property_descriptors, property_number, ecma_property_descriptor_t);
JMEM_DEFINE_LOCAL_ARRAY (property_descriptors, property_number, ecma_property_descriptor_t);
uint32_t property_descriptor_number = 0;
@@ -756,7 +756,7 @@ ecma_builtin_object_object_define_properties (ecma_value_t this_arg __attr_unuse
ecma_free_property_descriptor (&property_descriptors[index]);
}
MEM_FINALIZE_LOCAL_ARRAY (property_descriptors);
JMEM_FINALIZE_LOCAL_ARRAY (property_descriptors);
ecma_free_values_collection (prop_names_p, true);
@@ -794,9 +794,9 @@ ecma_builtin_string_prototype_object_replace_get_string (ecma_builtin_replace_se
if (context_p->is_replace_callable)
{
MEM_DEFINE_LOCAL_ARRAY (arguments_list,
match_length + 2,
ecma_value_t);
JMEM_DEFINE_LOCAL_ARRAY (arguments_list,
match_length + 2,
ecma_value_t);
/* An error might occure during the array copy and
* uninitalized elements must not be freed. */
@@ -847,7 +847,7 @@ ecma_builtin_string_prototype_object_replace_get_string (ecma_builtin_replace_se
ecma_free_value (arguments_list[i]);
}
MEM_FINALIZE_LOCAL_ARRAY (arguments_list);
JMEM_FINALIZE_LOCAL_ARRAY (arguments_list);
}
else
{
@@ -2078,9 +2078,9 @@ ecma_builtin_string_prototype_object_conversion_helper (ecma_value_t this_arg, /
/* Second phase. */
MEM_DEFINE_LOCAL_ARRAY (output_start_p,
output_length,
lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (output_start_p,
output_length,
lit_utf8_byte_t);
lit_utf8_byte_t *output_char_p = output_start_p;
@@ -2120,7 +2120,7 @@ ecma_builtin_string_prototype_object_conversion_helper (ecma_value_t this_arg, /
ret_value = ecma_make_string_value (output_string_p);
MEM_FINALIZE_LOCAL_ARRAY (output_start_p);
JMEM_FINALIZE_LOCAL_ARRAY (output_start_p);
ECMA_FINALIZE_UTF8_STRING (input_start_p, input_start_size);
ECMA_FINALIZE (to_string_val);
@@ -69,9 +69,9 @@ ecma_builtin_string_object_from_char_code (ecma_value_t this_arg __attr_unused__
{
lit_utf8_size_t utf8_buf_size = args_number * LIT_CESU8_MAX_BYTES_IN_CODE_UNIT;
MEM_DEFINE_LOCAL_ARRAY (utf8_buf_p,
utf8_buf_size,
lit_utf8_byte_t);
JMEM_DEFINE_LOCAL_ARRAY (utf8_buf_p,
utf8_buf_size,
lit_utf8_byte_t);
lit_utf8_size_t utf8_buf_used = 0;
@@ -96,7 +96,7 @@ ecma_builtin_string_object_from_char_code (ecma_value_t this_arg __attr_unused__
ret_string_p = ecma_new_ecma_string_from_utf8 (utf8_buf_p, utf8_buf_used);
}
MEM_FINALIZE_LOCAL_ARRAY (utf8_buf_p);
JMEM_FINALIZE_LOCAL_ARRAY (utf8_buf_p);
}
if (ecma_is_value_empty (ret_value))