* src/system.h (LIST_FREE, shortcpy): New.

* src/LR0.c: Use them.
* src/output.c (free_itemsets, free_reductions, free_shifts):
Remove, replaced by LIST_FREE.
This commit is contained in:
Akim Demaille
2001-11-19 09:14:54 +00:00
parent b4a7a230f1
commit 377bd7c9a2
5 changed files with 31 additions and 76 deletions

View File

@@ -279,6 +279,21 @@ do { \
#endif
/* As memcpy, but for shorts. */
#define shortcpy(Dest, Src, Num) \
memcpy (Dest, Src, Num * sizeof (short))
/* Free a linked list. */
#define LIST_FREE(Type, List) \
do { \
Type *_node, *_next; \
for (_node = List; _node; _node = _next) \
{ \
_next = _node->next; \
XFREE (_node); \
} \
} while (0)
/*---------------------------------.
| Debugging the memory allocator. |
`---------------------------------*/