From 375d580671a0e20f43451f72247801048c0d25cb Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 29 Dec 2001 14:21:23 +0000 Subject: [PATCH] Memory leak. * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here, since it allocates it for each state, although only one is needed. (allocate_storage): Do it here. --- ChangeLog | 9 +++++++++ src/LR0.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 94275232..afca4bb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-12-29 Akim Demaille + + Memory leak. + + * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here, + since it allocates it for each state, although only one is needed. + (allocate_storage): Do it here. + + 2001-12-29 Akim Demaille * src/options.h, src/options.c (create_long_option_table): Rename diff --git a/src/LR0.c b/src/LR0.c index 3f06fedf..e914c6ef 100644 --- a/src/LR0.c +++ b/src/LR0.c @@ -113,6 +113,7 @@ allocate_storage (void) shiftset = XCALLOC (short, nsyms); redset = XCALLOC (short, nrules + 1); state_hash = XCALLOC (state_t *, STATE_HASH_SIZE); + shift_symbol = XCALLOC (short, nsyms); } @@ -154,7 +155,6 @@ new_itemsets (void) for (i = 0; i < nsyms; i++) kernel_size[i] = 0; - shift_symbol = XCALLOC (short, nsyms); nshifts = 0; for (i = 0; i < nitemset; ++i) -- 2.47.2