make(1): inline Vector_Done

This commit is contained in:
rillig 2020-12-04 20:08:07 +00:00
parent 7943068f01
commit dfc53e1755
2 changed files with 8 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lst.c,v 1.98 2020/12/04 14:39:56 rillig Exp $ */
/* $NetBSD: lst.c,v 1.99 2020/12/04 20:08:07 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -34,7 +34,7 @@
#include "make.h"
MAKE_RCSID("$NetBSD: lst.c,v 1.98 2020/12/04 14:39:56 rillig Exp $");
MAKE_RCSID("$NetBSD: lst.c,v 1.99 2020/12/04 20:08:07 rillig Exp $");
static ListNode *
LstNodeNew(ListNode *prev, ListNode *next, void *datum)
@ -294,9 +294,3 @@ Vector_Pop(Vector *v)
v->len--;
return Vector_Get(v, v->len);
}
void
Vector_Done(Vector *v)
{
free(v->items);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: lst.h,v 1.90 2020/11/28 23:13:28 rillig Exp $ */
/* $NetBSD: lst.h,v 1.91 2020/12/04 20:08:07 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@ -187,6 +187,10 @@ Vector_Get(Vector *v, size_t i)
void *Vector_Push(Vector *);
void *Vector_Pop(Vector *);
void Vector_Done(Vector *);
MAKE_INLINE void
Vector_Done(Vector *v) {
free(v->items);
}
#endif /* MAKE_LST_H */