/*--------------------------------------------------------------------*/
-void *
-TlAlloc(struct tokenlist *tl, unsigned len)
+void
+TlFree(struct tokenlist *tl, void *p)
{
struct membit *mb;
- void *p;
- p = calloc(len, 1);
- assert(p != NULL);
mb = calloc(sizeof *mb, 1);
assert(mb != NULL);
mb->ptr = p;
TAILQ_INSERT_TAIL(&tl->membits, mb, list);
+}
+
+
+void *
+TlAlloc(struct tokenlist *tl, unsigned len)
+{
+ void *p;
+
+ p = calloc(len, 1);
+ assert(p != NULL);
+ TlFree(tl, p);
return (p);
}
void Ff(const struct tokenlist *tl, int indent, const char *fmt, ...);
void EncToken(struct vsb *sb, const struct token *t);
int IsMethod(const struct token *t);
+void TlFree(struct tokenlist *tl, void *p);
void *TlAlloc(struct tokenlist *tl, unsigned len);
/* vcc_obj.c */
asprintf(&p, "VRT_GetHdr(sp, %s, \"\\%03o%s:\")", v->hdr,
(unsigned)(strlen(v->name + vh->len) + 1), v->name + vh->len);
AN(p);
+ TlFree(tl, p);
v->rname = p;
asprintf(&p, "VRT_SetHdr(sp, %s, \"\\%03o%s:\", ", v->hdr,
(unsigned)(strlen(v->name + vh->len) + 1), v->name + vh->len);
AN(p);
+ TlFree(tl, p);
v->lname = p;
return (v);
}