+ size = heapinfo1[block1].busy_frag.frag_size[frag1];
+
+ if(type_id != NULL){
+ free(types1[block1][frag1]);
+ free(types2[block2][frag2]);
+ types1[block1][frag1] = strdup(type_id);
+ types2[block2][frag2] = strdup(type_id);
+ }
+
+ if(real_addr_frag1 != area1 || real_addr_frag2 != area2){
+ offset1 = (char *)area1 - (char *)real_addr_frag1;
+ offset2 = (char *)area2 - (char *)real_addr_frag2;
+ if(types1[block1][frag1] != NULL && types2[block2][frag2] != NULL){
+ new_type_id1 = get_offset_type(types1[block1][frag1], offset1, all_types, other_types, size, &switch_type);
+ new_type_id2 = get_offset_type(types2[block2][frag2], offset1, all_types, other_types, size, &switch_type);
+ }else if(types1[block1][frag1] != NULL){
+ new_type_id1 = get_offset_type(types1[block1][frag1], offset1, all_types, other_types, size, &switch_type);
+ new_type_id2 = get_offset_type(types1[block1][frag1], offset2, all_types, other_types, size, &switch_type);
+ }else if(types2[block2][frag2] != NULL){
+ new_type_id1 = get_offset_type(types2[block2][frag2], offset1, all_types, other_types, size, &switch_type);
+ new_type_id2 = get_offset_type(types2[block2][frag2], offset2, all_types, other_types, size, &switch_type);
+ }else{
+ return -1;
+ }
+
+ if(new_type_id1 != NULL && new_type_id2 != NULL && !strcmp(new_type_id1, new_type_id2)){
+ if(switch_type){
+ type = xbt_dict_get_or_null(other_types, new_type_id1);
+ while(type->size == 0 && type->dw_type_id != NULL)
+ type = xbt_dict_get_or_null(other_types, type->dw_type_id);
+ new_size1 = type->size;
+ type = xbt_dict_get_or_null(other_types, new_type_id2);
+ while(type->size == 0 && type->dw_type_id != NULL)
+ type = xbt_dict_get_or_null(other_types, type->dw_type_id);
+ new_size2 = type->size;
+ }else{
+ type = xbt_dict_get_or_null(all_types, new_type_id1);
+ while(type->size == 0 && type->dw_type_id != NULL)
+ type = xbt_dict_get_or_null(all_types, type->dw_type_id);
+ new_size1 = type->size;
+ type = xbt_dict_get_or_null(all_types, new_type_id2);
+ while(type->size == 0 && type->dw_type_id != NULL)
+ type = xbt_dict_get_or_null(all_types, type->dw_type_id);
+ new_size2 = type->size;
+ }
+ }else{
+ return -1;