@@ -94,6 +94,7 @@ typedef struct
94
94
*/
95
95
ecma_tag_t size_type : 4 ;
96
96
} ecma_string_t ;
97
+ JERRY_STATIC_ASSERT (sizeof (ecma_string_t ) == sizeof (ecma_tag_t ), sizeof_ecma_string_t_is_ecma_tag_size );
97
98
98
99
/**
99
100
* Actual data of ecma_compact_string_t depending on `tag::utf16` `tag::size_type`)
@@ -115,7 +116,8 @@ JERRY_STATIC_ASSERT (sizeof (ecma_compact_string_t) == 8, sizeof_ecma_compact_st
115
116
/**
116
117
* Actual data of ecma_internal_string_t depending on `tag::utf16` and `tag::size_type` field)
117
118
* the hash is stored in header
118
- * size_bits = `tag::size_type` << (3 + utf16)
119
+ * size_bits = `tag::size_type` << 3
120
+ * for utf16 satisfy `size_bits % 16 === 0`
119
121
* size is stored in ecma_internal_string_t::u::size(length is `tag::size_type << utf16` bytes)
120
122
*/
121
123
typedef union
@@ -152,7 +154,7 @@ typedef struct
152
154
#if JERRY_CPOINTER_16_BIT
153
155
uint32_t size ;
154
156
#else
155
- uintptr_t size ;
157
+ uint64_t size ;
156
158
#endif
157
159
ecma_external_string_body_t body ;
158
160
} ecma_external_string_t ;
@@ -163,7 +165,7 @@ JERRY_STATIC_ASSERT (sizeof (ecma_external_string_t) == 32, sizeof_ecma_external
163
165
#if UINTPTR_MAX > UINT32_MAX
164
166
JERRY_STATIC_ASSERT (sizeof (ecma_external_string_t ) == 32 , sizeof_ecma_external_string_t_equal_32 );
165
167
#else
166
- JERRY_STATIC_ASSERT (sizeof (ecma_external_string_t ) == 20 , sizeof_ecma_external_string_t_equal_20 );
168
+ JERRY_STATIC_ASSERT (sizeof (ecma_external_string_t ) == 24 , sizeof_ecma_external_string_t_equal_24 );
167
169
#endif /* UINTPTR_MAX > UINT32_MAX */
168
170
#elif JERRY_CPOINTER_16_BIT
169
171
#if UINTPTR_MAX > UINT32_MAX
0 commit comments