mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 05:43:03 +00:00
* 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:
15
src/system.h
15
src/system.h
@@ -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. |
|
||||
`---------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user