File tree 3 files changed +22
-8
lines changed
3 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -211,8 +211,9 @@ ecma_find_empty_literal_string_slot (void)
211
211
* @return jmem_cpointer_t slot pointer
212
212
*/
213
213
214
+ #if !JERRY_LIT_HASHMAP
214
215
static jmem_cpointer_t *
215
- ecma_find_empty_or_same_literal_string_slot (ecma_string_t * string_p )
216
+ ecma_find_empty_or_same_literal_string_slot (ecma_string_t * string_p /**< string to be searched */ )
216
217
{
217
218
jmem_cpointer_t string_list_cp = JERRY_CONTEXT (string_list_first_cp );
218
219
jmem_cpointer_t * empty_cpointer_p = NULL ;
@@ -250,6 +251,7 @@ ecma_find_empty_or_same_literal_string_slot (ecma_string_t *string_p)
250
251
251
252
return ecma_allocate_new_string_slot ();
252
253
} /* ecma_find_empty_or_same_literal_string_slot */
254
+ #endif
253
255
254
256
/**
255
257
* Find or create a literal string.
Original file line number Diff line number Diff line change 26
26
#define HASHMAP_ALWAYS_INLINE __attribute__ ((always_inline)) inline
27
27
#define HASHMAP_LINEAR_PROBE_LENGTH (8)
28
28
29
+ /**
30
+ * hashmap creation options.
31
+ */
32
+
29
33
typedef struct hashmap_create_options_s
30
34
{
31
- hashmap_uint32_t initial_capacity ;
35
+ hashmap_uint32_t initial_capacity ; /**< initial hashmap capacity */
32
36
} hashmap_create_options_t ;
33
37
34
38
/// @brief Create a hashmap.
Original file line number Diff line number Diff line change @@ -30,18 +30,26 @@ typedef uint8_t hashmap_uint8_t;
30
30
typedef uint32_t hashmap_uint32_t ;
31
31
typedef uint64_t hashmap_uint64_t ;
32
32
33
+ /**
34
+ * hashmap element
35
+ */
36
+
33
37
typedef struct hashmap_element_s
34
38
{
35
- const ecma_string_t * data ;
39
+ const ecma_string_t * data ; /**< point to a literal */
36
40
} hashmap_element_t ;
37
41
42
+ /**
43
+ * hashmap structure
44
+ */
45
+
38
46
typedef struct hashmap_s
39
47
{
40
- hashmap_uint32_t log2_capacity ;
41
- hashmap_uint32_t size ;
42
- struct hashmap_element_s * data ;
43
- size_t alloc_size ;
44
- uint8_t initialized ;
48
+ hashmap_uint32_t log2_capacity ; /**< hashmap capacity */
49
+ hashmap_uint32_t size ; /**< hashmap size*/
50
+ struct hashmap_element_s * data ; /**< element array */
51
+ size_t alloc_size ; /**< allocated size */
52
+ uint8_t initialized ; /**< 0 if not initialized */
45
53
} hashmap_t ;
46
54
47
55
/// @brief Initialize the hashmap.
You can’t perform that action at this time.
0 commit comments