@@ -94,13 +94,13 @@ void mem_heap_valgrind_freya_mempool_request (void)
94
94
*/
95
95
typedef enum : uint8_t
96
96
{
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) */
104
104
} mem_block_length_type_t ;
105
105
106
106
/* *
@@ -244,7 +244,7 @@ ssize_t mem_heap_allocated_bytes[MEM_HEAP_CHUNKS_NUM];
244
244
*
245
245
* The array contains one entry per heap chunk with:
246
246
* - 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.
248
248
*/
249
249
mem_block_length_type_t mem_heap_length_types[MEM_HEAP_CHUNKS_NUM];
250
250
#endif /* !JERRY_NDEBUG */
@@ -349,7 +349,7 @@ mem_heap_init (void)
349
349
for (size_t i = 0 ; i < MEM_HEAP_CHUNKS_NUM; i++)
350
350
{
351
351
#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 );
353
353
#endif /* !JERRY_NDEBUG */
354
354
355
355
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
388
388
mem_heap_alloc_term_t alloc_term) /* *< expected allocation term */
389
389
{
390
390
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
392
392
|| size_in_bytes == mem_heap_get_chunked_block_data_size ());
393
393
394
394
mem_check_heap ();
@@ -490,7 +490,7 @@ void* mem_heap_alloc_block_internal (size_t size_in_bytes, /**< size of region t
490
490
mem_heap_mark_chunk_allocated (chunk_index, false );
491
491
492
492
#ifndef JERRY_NDEBUG
493
- JERRY_ASSERT (length_type == mem_block_length_type_t ::GENERAL
493
+ JERRY_ASSERT (length_type == MEM_BLOCK_LENGTH_TYPE_GENERAL
494
494
&& mem_heap_length_types[chunk_index] == length_type);
495
495
#endif /* !JERRY_NDEBUG */
496
496
}
@@ -593,7 +593,7 @@ mem_heap_alloc_block (size_t size_in_bytes, /**< size of region to a
593
593
else
594
594
{
595
595
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 ,
597
597
alloc_term);
598
598
}
599
599
} /* mem_heap_alloc_block */
@@ -617,7 +617,7 @@ void*
617
617
mem_heap_alloc_chunked_block (mem_heap_alloc_term_t alloc_term) /* *< expected allocation term */
618
618
{
619
619
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 ,
621
621
alloc_term);
622
622
} /* mem_heap_alloc_chunked_block */
623
623
@@ -734,7 +734,7 @@ mem_heap_free_block (void *ptr) /**< pointer to beginning of data space of the b
734
734
#endif /* MEM_HEAP_ENABLE_ALLOCATED_BYTES_ARRAY */
735
735
736
736
#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 ;
738
738
#endif /* !JERRY_NDEBUG */
739
739
740
740
mem_check_heap ();
@@ -769,7 +769,7 @@ mem_heap_get_chunked_block_start (void *ptr) /**< pointer into a block */
769
769
770
770
#ifndef JERRY_NDEBUG
771
771
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 );
773
773
#endif /* !JERRY_NDEBUG */
774
774
775
775
return (void *) uintptr_chunk_aligned;
@@ -993,7 +993,7 @@ mem_check_heap (void)
993
993
994
994
if ((MEM_HEAP_IS_ALLOCATED_BITMAP[bitmap_item_index] & bit) != 0 )
995
995
{
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 )
997
997
{
998
998
JERRY_ASSERT ((MEM_HEAP_IS_FIRST_IN_BLOCK_BITMAP[bitmap_item_index] & bit) != 0 );
999
999
}
0 commit comments