Explorar el Código

Don't show stats or error messages if sbrk fails and PRINT_STATS is not enabled.

Ioannis Koutras hace 14 años
padre
commit
622b51c236
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      src/sys_alloc.c

+ 2 - 0
src/sys_alloc.c

@@ -65,9 +65,11 @@ void *sys_alloc(allocator_t *allocator, heap_t *heap, size_t size) {
 #ifndef WITH_MEMORY_SPACE_AWARENESS
     ptr = sbrk((int) allocation_size);
     if(ptr == (void *) -1) {
+#ifdef WITH_STATS
         printf("sbrk problem for size of: %zu\n", allocation_size);
         printf("Error on sbrk: %s\n", strerror( errno ) );
         print_stats(allocator);
+#endif /* WITH_STATS */
         return NULL;
     }   
 #if defined (COALESCING_FIXED) || defined (COALESCING_VARIABLE)