Implementing object model, memory allocators finalization routines. Adding assertion that all memory was freed before exit.

This commit is contained in:
Ruben Ayrapetyan
2014-08-07 19:24:32 +04:00
parent 5e1c4b533f
commit 99c15ef802
16 changed files with 140 additions and 20 deletions
+20 -3
View File
@@ -38,15 +38,32 @@ JERRY_STATIC_ASSERT( MEM_HEAP_AREA_SIZE <= 64 * 1024 );
void
mem_init( void)
{
mem_heap_init( mem_heap_area, sizeof (mem_heap_area));
mem_pools_init();
mem_heap_init( mem_heap_area, sizeof (mem_heap_area));
mem_pools_init();
} /* mem_init */
/**
* Finalize memory allocators.
*/
void
mem_finalize( bool is_show_mem_stats) /**< show heap memory stats
before finalization? */
{
mem_pools_finalize();
if (is_show_mem_stats)
{
mem_heap_print( false, false, true);
}
mem_heap_finalize();
} /* mem_finalize */
/**
* Get base pointer for allocation area.
*/
uintptr_t
mem_get_base_pointer( void)
{
return (uintptr_t) mem_heap_area;
return (uintptr_t) mem_heap_area;
} /* mem_get_base_pointer */