Skip to content

Commit a6c6f9f

Browse files
committed
uint64_t
1 parent f098342 commit a6c6f9f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test-api.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ typedef struct
9494
*/
9595
ecma_tag_t size_type : 4;
9696
} ecma_string_t;
97+
JERRY_STATIC_ASSERT (sizeof (ecma_string_t) == sizeof (ecma_tag_t), sizeof_ecma_string_t_is_ecma_tag_size);
9798

9899
/**
99100
* 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
115116
/**
116117
* Actual data of ecma_internal_string_t depending on `tag::utf16` and `tag::size_type` field)
117118
* 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`
119121
* size is stored in ecma_internal_string_t::u::size(length is `tag::size_type << utf16` bytes)
120122
*/
121123
typedef union
@@ -152,7 +154,7 @@ typedef struct
152154
#if JERRY_CPOINTER_16_BIT
153155
uint32_t size;
154156
#else
155-
uintptr_t size;
157+
uint64_t size;
156158
#endif
157159
ecma_external_string_body_t body;
158160
} ecma_external_string_t;
@@ -163,7 +165,7 @@ JERRY_STATIC_ASSERT (sizeof (ecma_external_string_t) == 32, sizeof_ecma_external
163165
#if UINTPTR_MAX > UINT32_MAX
164166
JERRY_STATIC_ASSERT (sizeof (ecma_external_string_t) == 32, sizeof_ecma_external_string_t_equal_32);
165167
#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);
167169
#endif /* UINTPTR_MAX > UINT32_MAX */
168170
#elif JERRY_CPOINTER_16_BIT
169171
#if UINTPTR_MAX > UINT32_MAX

0 commit comments

Comments
 (0)