|
@@ -1,3 +1,4 @@
|
|
|
+#define _BSD_SOURCE
|
|
|
#include <unistd.h>
|
|
|
#include <stdio.h>
|
|
|
#include "posix_lock.h"
|
|
@@ -17,7 +18,7 @@ void setHeaders(void *ptr, size_t sz) {
|
|
|
}
|
|
|
|
|
|
void *sys_alloc(size_t size) {
|
|
|
- unsigned int allocation_size;
|
|
|
+ size_t allocation_size;
|
|
|
void *ptr;
|
|
|
|
|
|
sbrk_lock();
|
|
@@ -25,7 +26,7 @@ void *sys_alloc(size_t size) {
|
|
|
|
|
|
if (borderPtr == NULL) {
|
|
|
|
|
|
- ptr = sbrk(allocation_size + 2*HDR_SIZE);
|
|
|
+ ptr = sbrk((intptr_t) (allocation_size + 2*HDR_SIZE));
|
|
|
|
|
|
if (ptr == (void *) -1){
|
|
|
printf("sbrk Fail\n");
|
|
@@ -40,7 +41,7 @@ void *sys_alloc(size_t size) {
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- ptr = sbrk(allocation_size);
|
|
|
+ ptr = sbrk((intptr_t) allocation_size);
|
|
|
|
|
|
if ((ptr == (char *) -1)){
|
|
|
printf("sbrk Fail: out of Memory\n");
|