|
@@ -27,7 +27,6 @@
|
|
|
#include "other.h"
|
|
|
#include "sys_alloc.h"
|
|
|
#include "block_header.h"
|
|
|
-#include "print_stats.h"
|
|
|
|
|
|
void *sys_alloc(allocator_t *allocator, heap_t *heap, size_t size) {
|
|
|
|
|
@@ -55,12 +54,13 @@ void *sys_alloc(allocator_t *allocator, heap_t *heap, size_t size) {
|
|
|
printf("Error on sbrk: %s\n", strerror( errno ) );
|
|
|
return NULL;
|
|
|
}
|
|
|
+#if defined (COALESCING_FIXED) || defined (COALESCING_VARIABLE)
|
|
|
if(allocator->border_ptr != NULL && ptr != (void *)
|
|
|
((char *) allocator->border_ptr + previous_size)) {
|
|
|
- printf("sbrk() does not return sequential space.\n");
|
|
|
- print_stats(allocator);
|
|
|
- return NULL;
|
|
|
+ printf("sbrk() does not return sequential space. "
|
|
|
+ "You should disable coalescing.\n");
|
|
|
}
|
|
|
+#endif /* COALESCING_FIXED || COALESCING_VARIABLE */
|
|
|
#else
|
|
|
if(allocator->remaining_size >= allocation_size) {
|
|
|
ptr = (void *) ((char *) allocator->border_ptr + previous_size);
|