FreeBSD/cddl/contrib/opensolaris/tools/ctf/cvt/tdata.c
/* Merge td2 into td1.  td2 is destroyed by the merge */
Merge td2 into td1.  td2 is destroyed by the merge
Merge td2 into td1 . td2 is destroyed by the merge
void
tdata_merge(tdata_t *td1, tdata_t *td2)
{
	td1->td_curemark = MAX(td1->td_curemark, td2->td_curemark);
	td1->td_curvgen = MAX(td1->td_curvgen, td2->td_curvgen);
	td1->td_nextid = MAX(td1->td_nextid, td2->td_nextid);
	hash_merge(td1->td_iihash, td2->td_iihash);
	tdata_build_hashes_common(td1, td2->td_iihash);
	list_concat(&td1->td_fwdlist, td2->td_fwdlist);
	td2->td_fwdlist = NULL;
	slist_merge(&td1->td_labels, td2->td_labels,
	    tdata_label_cmp);
	td2->td_labels = NULL;
	hash_free(td2->td_layouthash, NULL, NULL);
	td2->td_layouthash = NULL;
	hash_free(td2->td_iihash, NULL, NULL);
	td2->td_iihash = NULL;
	tdata_free(td2);
}
void tdata_merge ( tdata_t * td1 , tdata_t * td2 ) { td1 -> td_curemark = MAX ( td1 -> td_curemark , td2 -> td_curemark ) ; td1 -> td_curvgen = MAX ( td1 -> td_curvgen , td2 -> td_curvgen ) ; td1 -> td_nextid = MAX ( td1 -> td_nextid , td2 -> td_nextid ) ; hash_merge ( td1 -> td_iihash , td2 -> td_iihash ) ; tdata_build_hashes_common ( td1 , td2 -> td_iihash ) ; list_concat ( & td1 -> td_fwdlist , td2 -> td_fwdlist ) ; td2 -> td_fwdlist = NULL ; slist_merge ( & td1 -> td_labels , td2 -> td_labels , tdata_label_cmp ) ; td2 -> td_labels = NULL ; hash_free ( td2 -> td_layouthash , NULL , NULL ) ; td2 -> td_layouthash = NULL ; hash_free ( td2 -> td_iihash , NULL , NULL ) ; td2 -> td_iihash = NULL ; tdata_free ( td2 ) ; }
Merge td2 into td1.
Merge td2 into td1 .
/* Add td2's type tree to the hashes */ /* free the td2 hashes (data is now part of td1) */