@@ -94,13 +94,13 @@ void mem_heap_valgrind_freya_mempool_request (void)
9494 */
9595typedef enum : uint8_t
9696{
97- GENERAL = 0 , /* *< general (may be multi-chunk) block
98- *
99- * Note:
100- * As zero is used for initialization in mem_heap_init,
101- * 0 value for the GENERAL is necessary
102- */
103- ONE_CHUNKED = 1 /* *< one-chunked block (See also: mem_heap_alloc_chunked_block) */
97+ MEM_BLOCK_LENGTH_TYPE_GENERAL = 0 , /* *< general (may be multi-chunk) block
98+ *
99+ * Note:
100+ * As zero is used for initialization in mem_heap_init,
101+ * 0 value for the MEM_BLOCK_LENGTH_TYPE_GENERAL is necessary
102+ */
103+ MEM_BLOCK_LENGTH_TYPE_ONE_CHUNKED = 1 /* *< one-chunked block (See also: mem_heap_alloc_chunked_block) */
104104} mem_block_length_type_t ;
105105
106106/* *
@@ -244,7 +244,7 @@ ssize_t mem_heap_allocated_bytes[MEM_HEAP_CHUNKS_NUM];
244244 *
245245 * The array contains one entry per heap chunk with:
246246 * - length type of corresponding block, if the chunk is at start of an allocated block;
247- * - GENERAL length type for rest chunks.
247+ * - MEM_BLOCK_LENGTH_TYPE_GENERAL length type for rest chunks.
248248 */
249249mem_block_length_type_t mem_heap_length_types[MEM_HEAP_CHUNKS_NUM];
250250#endif /* !JERRY_NDEBUG */
@@ -349,7 +349,7 @@ mem_heap_init (void)
349349 for (size_t i = 0 ; i < MEM_HEAP_CHUNKS_NUM; i++)
350350 {
351351#ifndef JERRY_NDEBUG
352- JERRY_ASSERT (mem_heap_length_types[i] == mem_block_length_type_t ::GENERAL );
352+ JERRY_ASSERT (mem_heap_length_types[i] == MEM_BLOCK_LENGTH_TYPE_GENERAL );
353353#endif /* !JERRY_NDEBUG */
354354
355355 JERRY_ASSERT (mem_heap_allocated_bytes[i] == -1 );
@@ -388,7 +388,7 @@ void* mem_heap_alloc_block_internal (size_t size_in_bytes, /**< size of region t
388388 mem_heap_alloc_term_t alloc_term) /* *< expected allocation term */
389389{
390390 JERRY_ASSERT (size_in_bytes != 0 );
391- JERRY_ASSERT (length_type != mem_block_length_type_t ::ONE_CHUNKED
391+ JERRY_ASSERT (length_type != MEM_BLOCK_LENGTH_TYPE_ONE_CHUNKED
392392 || size_in_bytes == mem_heap_get_chunked_block_data_size ());
393393
394394 mem_check_heap ();
@@ -490,7 +490,7 @@ void* mem_heap_alloc_block_internal (size_t size_in_bytes, /**< size of region t
490490 mem_heap_mark_chunk_allocated (chunk_index, false );
491491
492492#ifndef JERRY_NDEBUG
493- JERRY_ASSERT (length_type == mem_block_length_type_t ::GENERAL
493+ JERRY_ASSERT (length_type == MEM_BLOCK_LENGTH_TYPE_GENERAL
494494 && mem_heap_length_types[chunk_index] == length_type);
495495#endif /* !JERRY_NDEBUG */
496496 }
@@ -593,7 +593,7 @@ mem_heap_alloc_block (size_t size_in_bytes, /**< size of region to a
593593 else
594594 {
595595 return mem_heap_alloc_block_try_give_memory_back (size_in_bytes,
596- mem_block_length_type_t ::GENERAL ,
596+ MEM_BLOCK_LENGTH_TYPE_GENERAL ,
597597 alloc_term);
598598 }
599599} /* mem_heap_alloc_block */
@@ -617,7 +617,7 @@ void*
617617mem_heap_alloc_chunked_block (mem_heap_alloc_term_t alloc_term) /* *< expected allocation term */
618618{
619619 return mem_heap_alloc_block_try_give_memory_back (mem_heap_get_chunked_block_data_size (),
620- mem_block_length_type_t ::ONE_CHUNKED ,
620+ MEM_BLOCK_LENGTH_TYPE_ONE_CHUNKED ,
621621 alloc_term);
622622} /* mem_heap_alloc_chunked_block */
623623
@@ -734,7 +734,7 @@ mem_heap_free_block (void *ptr) /**< pointer to beginning of data space of the b
734734#endif /* MEM_HEAP_ENABLE_ALLOCATED_BYTES_ARRAY */
735735
736736#ifndef JERRY_NDEBUG
737- mem_heap_length_types[chunk_index] = mem_block_length_type_t ::GENERAL ;
737+ mem_heap_length_types[chunk_index] = MEM_BLOCK_LENGTH_TYPE_GENERAL ;
738738#endif /* !JERRY_NDEBUG */
739739
740740 mem_check_heap ();
@@ -769,7 +769,7 @@ mem_heap_get_chunked_block_start (void *ptr) /**< pointer into a block */
769769
770770#ifndef JERRY_NDEBUG
771771 size_t chunk_index = mem_heap_get_chunk_from_address ((void *) uintptr_chunk_aligned);
772- JERRY_ASSERT (mem_heap_length_types[chunk_index] == mem_block_length_type_t ::ONE_CHUNKED );
772+ JERRY_ASSERT (mem_heap_length_types[chunk_index] == MEM_BLOCK_LENGTH_TYPE_ONE_CHUNKED );
773773#endif /* !JERRY_NDEBUG */
774774
775775 return (void *) uintptr_chunk_aligned;
@@ -993,7 +993,7 @@ mem_check_heap (void)
993993
994994 if ((MEM_HEAP_IS_ALLOCATED_BITMAP[bitmap_item_index] & bit) != 0 )
995995 {
996- if (mem_heap_length_types[chunk_index] == mem_block_length_type_t ::ONE_CHUNKED )
996+ if (mem_heap_length_types[chunk_index] == MEM_BLOCK_LENGTH_TYPE_ONE_CHUNKED )
997997 {
998998 JERRY_ASSERT ((MEM_HEAP_IS_FIRST_IN_BLOCK_BITMAP[bitmap_item_index] & bit) != 0 );
999999 }
0 commit comments