type = ++fp->ctf_typemax;
type = LCTF_INDEX_TO_TYPE (fp, type, (fp->ctf_flags & LCTF_CHILD));
- dtd->dtd_data.ctt_name = ctf_str_add_pending (fp, name,
- &dtd->dtd_data.ctt_name);
+ dtd->dtd_data.ctt_name = ctf_str_add_ref (fp, name, &dtd->dtd_data.ctt_name);
dtd->dtd_type = type;
if (dtd->dtd_data.ctt_name == 0 && name != NULL && name[0] != '\0')
return -1; /* errno is set for us. */
en = (ctf_enum_t *) dtd->dtd_vlen;
- if (dtd->dtd_vlen != old_vlen)
- {
- ptrdiff_t move = (signed char *) dtd->dtd_vlen - (signed char *) old_vlen;
-
- /* Remove pending refs in the old vlen region and reapply them. */
-
- for (i = 0; i < vlen; i++)
- ctf_str_move_pending (fp, &en[i].cte_name, move);
- }
-
for (i = 0; i < vlen; i++)
if (strcmp (ctf_strptr (fp, en[i].cte_name), name) == 0)
return (ctf_set_errno (ofp, ECTF_DUPLICATE));
- en[i].cte_name = ctf_str_add_pending (fp, name, &en[i].cte_name);
+ en[i].cte_name = ctf_str_add_ref (fp, name, &en[i].cte_name);
en[i].cte_value = value;
if (en[i].cte_name == 0 && name != NULL && name[0] != '\0')
return (ctf_set_errno (ofp, ctf_errno (fp)));
memb = (ctf_lmember_t *) dtd->dtd_vlen;
- if (dtd->dtd_vlen != old_vlen)
- {
- ptrdiff_t move = (signed char *) dtd->dtd_vlen - (signed char *) old_vlen;
-
- /* Remove pending refs in the old vlen region and reapply them. */
-
- for (i = 0; i < vlen; i++)
- ctf_str_move_pending (fp, &memb[i].ctlm_name, move);
- }
-
if (name != NULL)
{
for (i = 0; i < vlen; i++)
return -1; /* errno is set for us. */
}
- memb[vlen].ctlm_name = ctf_str_add_pending (fp, name, &memb[vlen].ctlm_name);
+ memb[vlen].ctlm_name = ctf_str_add_ref (fp, name, &memb[vlen].ctlm_name);
memb[vlen].ctlm_type = type;
if (memb[vlen].ctlm_name == 0 && name != NULL && name[0] != '\0')
return -1; /* errno is set for us. */