Skip to content

Commit

Permalink
literal storage using hashmap
Browse files Browse the repository at this point in the history
JerryScript-DCO-1.0-Signed-off-by: Ronan Jezequel [email protected]
  • Loading branch information
ronanj committed Mar 18, 2024
1 parent c038811 commit 9604be5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions jerry-core/ecma/base/ecma-literal-storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ ecma_find_empty_literal_string_slot (void)

return ecma_allocate_new_string_slot ();
} /* ecma_find_empty_literal_string_slot */
#endif
#endif /* JERRY_LIT_HASHMAP */

/**
* Find an empty or similar a literal string slot.
Expand Down Expand Up @@ -251,7 +251,7 @@ ecma_find_empty_or_same_literal_string_slot (ecma_string_t *string_p /**< string

return ecma_allocate_new_string_slot ();
} /* ecma_find_empty_or_same_literal_string_slot */
#endif
#endif /* !JERRY_LIT_HASHMAP */

/**
* Find or create a literal string.
Expand Down
2 changes: 1 addition & 1 deletion jerry-core/lit/lit-hashmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ hashmap_iterate_pairs (struct hashmap_s *const m,
void *const context)
{
hashmap_uint32_t i;
struct hashmap_element_s *p;
int r;

for (i = 0; i < (hashmap_capacity (m) + HASHMAP_LINEAR_PROBE_LENGTH); i++)
{
struct hashmap_element_s *p;
p = &m->data[i];
if (p->data)
{
Expand Down
6 changes: 3 additions & 3 deletions jerry-core/lit/lit-hashmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ typedef struct hashmap_element_s
typedef struct hashmap_s
{
hashmap_uint32_t log2_capacity; /**< hashmap capacity */
hashmap_uint32_t size; /**< hashmap size*/
hashmap_uint32_t size; /**< hashmap size*/
struct hashmap_element_s *data; /**< element array */
size_t alloc_size; /**< allocated size */
uint8_t initialized; /**< 0 if not initialized */
size_t alloc_size; /**< allocated size */
uint8_t initialized; /**< 0 if not initialized */
} hashmap_t;

/// @brief Initialize the hashmap.
Expand Down

0 comments on commit 9604be5

Please sign in to comment.