Browse Source

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

Ioannis Koutras 13 years ago
parent
commit
622b51c236
1 changed files with 2 additions and 0 deletions
  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)