|
@@ -13,7 +13,7 @@ void setHeaders(void *ptr, size_t sz) {
|
|
|
setSize(ptr,sz);
|
|
|
markInUse(ptr);
|
|
|
setPrevSize(getNext(ptr), sz);
|
|
|
- setSize(getNext(ptr), 0); //border block
|
|
|
+ setSize(getNext(ptr), (size_t) 0); //border block
|
|
|
markInUse(getNext(ptr)); //border block
|
|
|
}
|
|
|
|
|
@@ -26,7 +26,7 @@ void *sys_alloc(size_t size) {
|
|
|
|
|
|
if (borderPtr == NULL) {
|
|
|
|
|
|
- ptr = sbrk((intptr_t) (allocation_size + 2*HDR_SIZE)); //extra space for coalescing support
|
|
|
+ ptr = sbrk((int) (allocation_size + 2*HDR_SIZE)); //extra space for coalescing support
|
|
|
|
|
|
if (ptr == (void *) -1){
|
|
|
printf("sbrk Fail\n");
|
|
@@ -35,13 +35,13 @@ void *sys_alloc(size_t size) {
|
|
|
|
|
|
//printf("sbrk = %p\n",ptr);
|
|
|
|
|
|
- setPrevSize((char *) ptr + HDR_SIZE, 0);
|
|
|
+ setPrevSize((char *) ptr + HDR_SIZE, (size_t) 0);
|
|
|
markPrevInUse((char *) ptr + HDR_SIZE);
|
|
|
borderPtr = ptr;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- ptr = sbrk((intptr_t) allocation_size);
|
|
|
+ ptr = sbrk((int) allocation_size);
|
|
|
|
|
|
if ((ptr == (char *) -1)){
|
|
|
printf("sbrk Fail: out of Memory\n");
|