Changeset 468 for soft/giet_vm/giet_libs/malloc.c
- Timestamp:
- Dec 12, 2014, 5:06:18 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/malloc.c
r431 r468 8 8 #include "malloc.h" 9 9 #include "stdio.h" 10 #include "giet_config.h" 10 11 11 12 // Global variables defining the heap descriptors array (one heap per cluster) … … 51 52 { 52 53 giet_shr_printf( 53 " - coordinates = [%d][%d]\n"54 54 " - heap_base = %x\n" 55 55 " - heap_size = %x\n" … … 80 80 " - free[22] = %x\n" 81 81 " - free[23] = %x\n", 82 heap[x][y].x, heap[x][y].y,83 82 heap[x][y].heap_base, heap[x][y].heap_size, 84 83 heap[x][y].alloc_base, heap[x][y].alloc_size, … … 115 114 heap_index = GET_SIZE_INDEX( heap_size ); 116 115 116 #if GIET_DEBUG_USER_MALLOC 117 giet_shr_printf("\n[DEBUG USER_MALLOC] Starting Heap[%d][%d] initialisation /" 118 " base = %x / size = %x\n", x, y, heap_base, heap_size ); 119 #endif 120 117 121 // checking heap segment constraints 118 122 if ( heap_size == 0 ) // heap segment exist … … 166 170 heap[x][y].alloc_base = alloc_base; 167 171 168 lock_ release( &heap[x][y].lock );169 170 #if GIET_DEBUG_ MALLOC171 giet_shr_printf("\n[ MALLOC DEBUG] Completing Heap[%d][%d] initialisation\n", x, y );172 lock_init( &heap[x][y].lock ); 173 174 #if GIET_DEBUG_USER_MALLOC 175 giet_shr_printf("\n[DEBUG USER_MALLOC] Completing Heap[%d][%d] initialisation\n", x, y ); 172 176 display_free_array(x,y); 173 177 #endif … … 238 242 { 239 243 240 #if GIET_DEBUG_ MALLOC241 giet_shr_printf("\n[ MALLOC DEBUG] Malloc request for Heap[%d][%d] / size = %x\n",244 #if GIET_DEBUG_USER_MALLOC 245 giet_shr_printf("\n[DEBUG USER_MALLOC] Malloc request for Heap[%d][%d] / size = %x\n", 242 246 x, y, size ); 243 247 #endif … … 260 264 if ( heap[x][y].init != HEAP_INITIALIZED ) 261 265 { 262 heap_init( x , y );266 heap_init( x , y ); 263 267 } 264 268 … … 288 292 lock_release( &heap[x][y].lock ); 289 293 290 #if GIET_DEBUG_ MALLOC291 giet_shr_printf("\n[ MALLOC DEBUG] Malloc vaddr from Heap[%d][%d] = %x\n",294 #if GIET_DEBUG_USER_MALLOC 295 giet_shr_printf("\n[DEBUG USER_MALLOC] Malloc vaddr from Heap[%d][%d] = %x\n", 292 296 x, y, base ); 293 297 display_free_array(x,y); … … 383 387 giet_get_xy( ptr, &x, &y ); 384 388 385 #if GIET_DEBUG_ MALLOC386 giet_shr_printf("\n[ MALLOC DEBUG] Free for vaddr = %x / x = %d / y = %d\n",389 #if GIET_DEBUG_USER_MALLOC 390 giet_shr_printf("\n[DEBUG USER_MALLOC] Free for vaddr = %x / x = %d / y = %d\n", 387 391 (unsigned int)ptr, x, y ); 388 392 #endif … … 418 422 lock_release( &heap[x][y].lock ); 419 423 420 #if GIET_DEBUG_ MALLOC424 #if GIET_DEBUG_USER_MALLOC 421 425 display_free_array(x,y); 422 426 #endif
Note: See TracChangeset
for help on using the changeset viewer.