;Р while((v!=NULL) && (v->len<w->len))//如果此结点还有多余,就此又重新插入到空闲区域链中(按照长度由小到大的次序排列)Р {Р u=v;Р v=v->next;Р }Р u->next=w;Р w->next=v;Р }Р?}Р?else Р printf("can't allocate!\n");Р}Рvoid freeMemo(char name) /* 模拟内存回收*/ Р{Р?struct busylink *p,*q;Р?struct freelink *w,*u,*v,*s1=NULL,*s2=NULL;Р?int len,address;Р?int flag1=1,flag2=1;Р?p=busy_head->next;Р?while((p!=NULL)&&(p->name!=name)) //找到要回收的结点Р?{Р q=p;Р p=p->next;Р?}Р?if(p==NULL)Р?{Р printf("%c is not exist\n",name);Р?}Р?elseР?{Р if (p==busy_tail) Р busy_tail=q;Р q->next=p->next;Р len=p->len;Р address=p->address;Р free(p);Р Р w=(struct freelink*) malloc(sizeof(freelink));Р w->len=len;Р w->address=address;Р u=free_head;Р v=free_head->next;Р while((v!=NULL) && (flag1==1 || flag2==1)) //归并算法Р {Р if((w->address==(v->address+v->len)) &&flag1) Р {Р s1=v;