Skip to content

Commit 9604be5

Browse files
committed
literal storage using hashmap
JerryScript-DCO-1.0-Signed-off-by: Ronan Jezequel [email protected]
1 parent c038811 commit 9604be5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

jerry-core/ecma/base/ecma-literal-storage.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ ecma_find_empty_literal_string_slot (void)
203203

204204
return ecma_allocate_new_string_slot ();
205205
} /* ecma_find_empty_literal_string_slot */
206-
#endif
206+
#endif /* JERRY_LIT_HASHMAP */
207207

208208
/**
209209
* Find an empty or similar a literal string slot.
@@ -251,7 +251,7 @@ ecma_find_empty_or_same_literal_string_slot (ecma_string_t *string_p /**< string
251251

252252
return ecma_allocate_new_string_slot ();
253253
} /* ecma_find_empty_or_same_literal_string_slot */
254-
#endif
254+
#endif /* !JERRY_LIT_HASHMAP */
255255

256256
/**
257257
* Find or create a literal string.

jerry-core/lit/lit-hashmap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ hashmap_iterate_pairs (struct hashmap_s *const m,
194194
void *const context)
195195
{
196196
hashmap_uint32_t i;
197-
struct hashmap_element_s *p;
198197
int r;
199198

200199
for (i = 0; i < (hashmap_capacity (m) + HASHMAP_LINEAR_PROBE_LENGTH); i++)
201200
{
201+
struct hashmap_element_s *p;
202202
p = &m->data[i];
203203
if (p->data)
204204
{

jerry-core/lit/lit-hashmap.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ typedef struct hashmap_element_s
4646
typedef struct hashmap_s
4747
{
4848
hashmap_uint32_t log2_capacity; /**< hashmap capacity */
49-
hashmap_uint32_t size; /**< hashmap size*/
49+
hashmap_uint32_t size; /**< hashmap size*/
5050
struct hashmap_element_s *data; /**< element array */
51-
size_t alloc_size; /**< allocated size */
52-
uint8_t initialized; /**< 0 if not initialized */
51+
size_t alloc_size; /**< allocated size */
52+
uint8_t initialized; /**< 0 if not initialized */
5353
} hashmap_t;
5454

5555
/// @brief Initialize the hashmap.

0 commit comments

Comments
 (0)