Browse Source

Print an error in case sbrk fails.

Ioannis Koutras 14 years ago
parent
commit
7e453a2760
1 changed files with 3 additions and 0 deletions
  1. 3 0
      sys_alloc.c

+ 3 - 0
sys_alloc.c

@@ -15,6 +15,9 @@ void *sys_alloc(heap_t *heap, size_t size) {
 	allocation_size = req_padding(size) + HEADER_SIZE;
 
 	ptr = sbrk((int) allocation_size);
+	if(ptr == (void *) -1) {
+		printf("sbrk problem for size of: %d\n", allocation_size);
+	}
 	ptr = (void *) ((char *) ptr + HEADER_SIZE);
 
 	set_size(ptr, req_padding(size));