Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "4a.h"
- #include <stdio.h> /* NULL */
- #include <stdlib.h>
- void buddy_free(void *addr)
- {
- if(addr == NULL)return;
- node_t node = (node_t)addr;
- bst_dump();
- printf("start: %d\n", (int)node);
- while(*node == NODE_FREE){
- //printf("start: %c\n", (char)*node);
- //printf("start: %c\n", (char)NODE_FREE);
- node_t par = bst_parent(node);
- if(par != NULL){
- node = par;
- }else{
- printf("WRONG ADRESS!\n");
- exit(255);
- }
- }
- *node = NODE_FREE;
- bst_housekeeping(bst_root());
- bst_dump();
- memory_dump();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement