diff --git a/tests/unit/test_addition_opcode_number_operands.c b/tests/unit/test_addition_opcode_number_operands.c index 8af97574b..1c840fde1 100644 --- a/tests/unit/test_addition_opcode_number_operands.c +++ b/tests/unit/test_addition_opcode_number_operands.c @@ -34,7 +34,7 @@ main( int __unused argc, getop_exitval( 0) }; - mem_Init(); + mem_init(); init_int( test_program); diff --git a/tests/unit/test_assignment_opcode.c b/tests/unit/test_assignment_opcode.c index 550c26e2a..0d12e410e 100644 --- a/tests/unit/test_assignment_opcode.c +++ b/tests/unit/test_assignment_opcode.c @@ -35,7 +35,7 @@ main( int __unused argc, getop_exitval( 0) }; - mem_Init(); + mem_init(); init_int( test_program); diff --git a/tests/unit/test_division_opcode.c b/tests/unit/test_division_opcode.c index f37444e98..e14084bbc 100644 --- a/tests/unit/test_division_opcode.c +++ b/tests/unit/test_division_opcode.c @@ -34,7 +34,7 @@ main( int __unused argc, getop_exitval( 0) }; - mem_Init(); + mem_init(); init_int( test_program); diff --git a/tests/unit/test_heap.c b/tests/unit/test_heap.c index 81cd2cbbf..1ee02e257 100644 --- a/tests/unit/test_heap.c +++ b/tests/unit/test_heap.c @@ -40,14 +40,14 @@ main( int __unused argc, { uint8_t test_native_heap[test_heap_size]; - mem_HeapInit( test_native_heap, sizeof (test_native_heap)); + mem_heap_init( test_native_heap, sizeof (test_native_heap)); srand((unsigned int) time(NULL)); int k = rand(); printf("seed=%d\n", k); srand((unsigned int) k); - mem_HeapPrint( false); + mem_heap_print( false); for ( uint32_t i = 0; i < test_iters; i++ ) { @@ -58,7 +58,7 @@ main( int __unused argc, for ( uint32_t j = 0; j < subiters; j++ ) { size_t size = (unsigned int) rand() % ( test_threshold_block_size ); - ptrs[j] = mem_HeapAllocBlock( size, ( rand() % 2 ) ? MEM_HEAP_ALLOC_SHORT_TERM : MEM_HEAP_ALLOC_SHORT_TERM); + ptrs[j] = mem_heap_alloc_block( size, ( rand() % 2 ) ? MEM_HEAP_ALLOC_SHORT_TERM : MEM_HEAP_ALLOC_SHORT_TERM); sizes[j] = size; if ( ptrs[j] != NULL ) { @@ -67,7 +67,7 @@ main( int __unused argc, // JERRY_ASSERT(ptrs[j] != NULL); } - // mem_HeapPrint( true); + // mem_heap_print( true); for ( uint32_t j = 0; j < subiters; j++ ) { @@ -77,12 +77,12 @@ main( int __unused argc, { JERRY_ASSERT( ptrs[j][k] == 0 ); } - mem_HeapFreeBlock( ptrs[j]); + mem_heap_free_block( ptrs[j]); } } } - mem_HeapPrint( false); + mem_heap_print( false); return 0; } /* main */ diff --git a/tests/unit/test_multiplication_opcode.c b/tests/unit/test_multiplication_opcode.c index b02b164cf..1bbd2bb29 100644 --- a/tests/unit/test_multiplication_opcode.c +++ b/tests/unit/test_multiplication_opcode.c @@ -34,7 +34,7 @@ main( int __unused argc, getop_exitval( 0) }; - mem_Init(); + mem_init(); init_int( test_program); diff --git a/tests/unit/test_pool.c b/tests/unit/test_pool.c index 88ad6d832..ba13627f1 100644 --- a/tests/unit/test_pool.c +++ b/tests/unit/test_pool.c @@ -48,41 +48,41 @@ main( int __unused argc, for ( uint32_t i = 0; i < test_iters; i++ ) { - mem_PoolState_t pool; + mem_pool_state_t pool; uint8_t test_pool[test_pool_area_size] __attribute__((aligned(MEM_ALIGNMENT))); - const size_t chunkSize = MEM_ALIGNMENT * ( ( (size_t) rand() % test_max_chunk_size_divided_by_alignment ) + 1 ); + const size_t chunk_size = MEM_ALIGNMENT * ( ( (size_t) rand() % test_max_chunk_size_divided_by_alignment ) + 1 ); - mem_PoolInit( &pool, chunkSize, test_pool, sizeof (test_pool)); + mem_pool_init( &pool, chunk_size, test_pool, sizeof (test_pool)); const size_t subiters = ( (size_t) rand() % test_max_sub_iters ) + 1; uint8_t* ptrs[subiters]; for ( size_t j = 0; j < subiters; j++ ) { - ptrs[j] = mem_PoolAllocChunk( &pool); + ptrs[j] = mem_pool_alloc_chunk( &pool); // TODO: Enable check with condition that j <= minimum count of chunks that fit in the pool // JERRY_ASSERT(ptrs[j] != NULL); if ( ptrs[j] != NULL ) { - memset(ptrs[j], 0, chunkSize); + memset(ptrs[j], 0, chunk_size); } } - // mem_HeapPrint( true); + // mem_heap_print( true); for ( size_t j = 0; j < subiters; j++ ) { if ( ptrs[j] != NULL ) { - for ( size_t k = 0; k < chunkSize; k++ ) + for ( size_t k = 0; k < chunk_size; k++ ) { JERRY_ASSERT( ((uint8_t*)ptrs[j])[k] == 0 ); } - mem_PoolFreeChunk( &pool, ptrs[j]); + mem_pool_free_chunk( &pool, ptrs[j]); } } } diff --git a/tests/unit/test_poolman.c b/tests/unit/test_poolman.c index d0cd47540..2810b43e5 100644 --- a/tests/unit/test_poolman.c +++ b/tests/unit/test_poolman.c @@ -44,8 +44,8 @@ main( int __unused argc, { uint8_t heap[test_heap_size] __attribute__((aligned(MEM_ALIGNMENT))); - mem_HeapInit( heap, sizeof (heap)); - mem_PoolsInit(); + mem_heap_init( heap, sizeof (heap)); + mem_pools_init(); srand((unsigned int) time(NULL)); unsigned int seed = (unsigned int)rand(); @@ -57,49 +57,49 @@ main( int __unused argc, const size_t subiters = ( (size_t) rand() % test_max_sub_iters ) + 1; uint8_t * ptrs[subiters]; - mem_PoolChunkType_t types[subiters]; + mem_pool_chunk_type_t types[subiters]; for ( size_t j = 0; j < subiters; j++ ) { - mem_PoolChunkType_t type = (mem_PoolChunkType_t) (rand() % MEM_POOL_CHUNK_TYPE__COUNT); - const size_t chunkSize = mem_GetChunkSize( type); + mem_pool_chunk_type_t type = (mem_pool_chunk_type_t) (rand() % MEM_POOL_CHUNK_TYPE__COUNT); + const size_t chunk_size = mem_get_chunk_size( type); types[j] = type; - ptrs[j] = mem_PoolsAlloc( type); + ptrs[j] = mem_pools_alloc( type); JERRY_ASSERT(ptrs[j] != NULL); if ( ptrs[j] != NULL ) { - __memset(ptrs[j], 0, chunkSize); + __memset(ptrs[j], 0, chunk_size); } } - // mem_HeapPrint( false); + // mem_heap_print( false); for ( size_t j = 0; j < subiters; j++ ) { if ( ptrs[j] != NULL ) { - mem_PoolChunkType_t type = types[j]; - const size_t chunkSize = mem_GetChunkSize( type); + mem_pool_chunk_type_t type = types[j]; + const size_t chunk_size = mem_get_chunk_size( type); - for ( size_t k = 0; k < chunkSize; k++ ) + for ( size_t k = 0; k < chunk_size; k++ ) { JERRY_ASSERT( ((uint8_t*) ptrs[j])[k] == 0 ); } - mem_PoolsFree( type, ptrs[j]); + mem_pools_free( type, ptrs[j]); } } } #ifdef MEM_STATS - mem_PoolsStats_t stats; - mem_PoolsGetStats( &stats); + mem_pools_stats_t stats; + mem_pools_get_stats( &stats); #endif /* MEM_STATS */ __printf("Pools stats:\n"); - for(mem_PoolChunkType_t type = 0; + for(mem_pool_chunk_type_t type = 0; type < MEM_POOL_CHUNK_TYPE__COUNT; type++) { @@ -109,7 +109,7 @@ main( int __unused argc, " Free chunks: %lu\n" " Peak pools: %lu\n" " Peak allocated chunks: %lu\n", - mem_GetChunkSize( type), + mem_get_chunk_size( type), stats.pools_count[ type ], stats.allocated_chunks[ type ], stats.free_chunks[ type ], diff --git a/tests/unit/test_remainder_opcode.c b/tests/unit/test_remainder_opcode.c index abdeb95df..a4b7328ce 100644 --- a/tests/unit/test_remainder_opcode.c +++ b/tests/unit/test_remainder_opcode.c @@ -34,7 +34,7 @@ main( int __unused argc, getop_exitval( 0) }; - mem_Init(); + mem_init(); init_int( test_program); diff --git a/tests/unit/test_substraction_opcode.c b/tests/unit/test_substraction_opcode.c index 19e0371a4..f8c8d64ab 100644 --- a/tests/unit/test_substraction_opcode.c +++ b/tests/unit/test_substraction_opcode.c @@ -34,7 +34,7 @@ main( int __unused argc, getop_exitval( 0) }; - mem_Init(); + mem_init(); init_int( test_program); diff --git a/tests/unit/test_var_decl_opcode_in_decl_lex_env.c b/tests/unit/test_var_decl_opcode_in_decl_lex_env.c index a1419ac98..ceedd75d4 100644 --- a/tests/unit/test_var_decl_opcode_in_decl_lex_env.c +++ b/tests/unit/test_var_decl_opcode_in_decl_lex_env.c @@ -30,7 +30,7 @@ main( int __unused argc, getop_exitval( 0) }; - mem_Init(); + mem_init(); init_int( test_program);