Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void try_newheap(){
- unsigned int testA;
- unsigned int testB;
- unsigned int testC;
- //printf("Testing the new heap (in development)\n");
- //printf("First step: testing a new heap...\n");
- //new_heap(HEAP_START_ADDRESS, HEAP_START_SIZE);
- printf("Second step: trying new_malloc...\n");
- testA=(unsigned int)new_malloc(8);
- printf("-Address of testA Hex: 0x%x\n", testA);
- testB=(unsigned int)new_malloc(8);
- printf("-Address of testB Hex: 0x%x\n", testB);
- //printf("testB - testA = %u", testB - testA);
- testC=new_malloc(8);
- printf("-Address of testC Hex: 0x%x\n", testC);
- new_free(testC);
- new_free(testB);
- unsigned int testD;
- unsigned int testE;
- testD = new_malloc(12);
- testE = new_malloc(12);
- printf("-Address of testD Hex: 0x%x\n", testD);
- //printf("-Address of testE Hex: 0x%x\n", testE);
- new_free(testA);
- new_free(testE);
- new_free(testD);
- printf("DONE\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement