Add more consts to external magic strings to get data moved from .data to .rodata. (#2534)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
@@ -634,7 +634,7 @@ Registers an external magic string array.
|
||||
|
||||
```c
|
||||
void
|
||||
jerry_register_magic_strings (const jerry_char_t **ex_str_items_p,
|
||||
jerry_register_magic_strings (const jerry_char_t * const *ex_str_items_p,
|
||||
uint32_t count,
|
||||
const jerry_length_t *str_lengths_p);
|
||||
```
|
||||
@@ -657,11 +657,11 @@ main (void)
|
||||
|
||||
// must be static, because 'jerry_register_magic_strings' does not copy
|
||||
// the items must be sorted by size at first, then lexicographically
|
||||
static const jerry_char_t *magic_string_items[] = {
|
||||
(const jerry_char_t *) "magicstring1",
|
||||
(const jerry_char_t *) "magicstring2",
|
||||
(const jerry_char_t *) "magicstring3"
|
||||
};
|
||||
static const jerry_char_t * const magic_string_items[] = {
|
||||
(const jerry_char_t *) "magicstring1",
|
||||
(const jerry_char_t *) "magicstring2",
|
||||
(const jerry_char_t *) "magicstring3"
|
||||
};
|
||||
uint32_t num_magic_string_items = (uint32_t) (sizeof (magic_string_items) / sizeof (jerry_char_t *));
|
||||
|
||||
// must be static, because 'jerry_register_magic_strings' does not copy
|
||||
|
||||
Reference in New Issue
Block a user