|
| 1 | +#include <stdio.h> |
| 2 | +#include <stdlib.h> |
| 3 | +#include "weigth.h" |
| 4 | + |
| 5 | +void initialize(); |
| 6 | + |
| 7 | +int main(){ |
| 8 | + printf("%d",ispow(24)); |
| 9 | + initialize(); |
| 10 | + print("\n"); |
| 11 | +} |
| 12 | + |
| 13 | +void initialize(){ |
| 14 | + mem=(void*)malloc(sizeof(msize)); |
| 15 | + printf("%p %ld",mem,sizeof(mem)); |
| 16 | + //printf("\n%d",(int)mem*2); |
| 17 | + avail fd; |
| 18 | + init(&fd); |
| 19 | + |
| 20 | + //void* c=(void*)bmalloc(&fd,5); |
| 21 | + char* c=(char*)bmalloc(&fd,sizeof(char)); |
| 22 | + printf("\nValue = %p",c); |
| 23 | + printdat(&fd); |
| 24 | + |
| 25 | + //void* fin=(void*)bmalloc(&fd,3); |
| 26 | + //printf(" %d",reqsize(1)); |
| 27 | + //printf(" %d",bsizearr(2)); |
| 28 | + int* x=(int*)bmalloc(&fd,sizeof(int)); |
| 29 | + printf("\nValue = %p %ld",x,sizeof(int)); |
| 30 | + printdat(&fd); |
| 31 | + //printf("\n%d",sizeof(char)); |
| 32 | + bfree(&fd,c); |
| 33 | + printdat(&fd); |
| 34 | + bfree(&fd,x); |
| 35 | + printdat(&fd); |
| 36 | + |
| 37 | + char* d=(char*)bmalloc(&fd,sizeof(char)); |
| 38 | + printdat(&fd); |
| 39 | + /*bmalloc(&fd,8); |
| 40 | +
|
| 41 | +
|
| 42 | + bmalloc(&fd,3); |
| 43 | + float* x1=(float*)bmalloc(&fd,sizeof(float)); |
| 44 | + if(x1!=NULL) |
| 45 | + *x1=2.654; |
| 46 | + printf("\nValue = %f ",*x1); |
| 47 | + bfree(&fd,x1); |
| 48 | + //printf("\n%d",ispow(3)); |
| 49 | + //printf("%d",splitter(32,2)); |
| 50 | + */ |
| 51 | + free(mem); |
| 52 | +} |
0 commit comments