Re: ECPG cleanup and fix for clang compile-time problem
Tom Lane <tgl@sss.pgh.pa.us>
Attachments
- v6-0001-ecpg-fix-some-memory-leakage-of-data-type-related.patch (text/x-diff) patch v6-0001
- v6-0002-ecpg-put-all-string-valued-tokens-returned-by-pgc.patch (text/x-diff) patch v6-0002
- v6-0003-ecpg-clean-up-some-other-assorted-memory-leaks.patch (text/x-diff) patch v6-0003
John Naylor <johncnaylorls@gmail.com> writes:
>> [v5]
Thanks for reviewing! I pushed 0001-0005 and 0009, adopting
your suggestions except for
> + /* List a token here if pgc.l assigns to base_yylval.str for it */
> Does pgc.l need to have a similar comment?
That's not a bad suggestion, but I couldn't see any very useful place
to put such a comment.
> I haven't looked closely at 0006 through 0009. One possible concern is
> that the regression tests might not cover very well, but if you can
> get valgrind silent for memory leaks for what they do cover, that's
> certainly a good step.
Attached are rebased and renumbered 0006-0008, mostly to keep the
cfbot happy. We could actually stop here, if we were feeling lazy,
but now that I've done the work I'm inclined to push forward with
the rest.
The rest is just memory leak removal, and I suspect that nobody really
cares that much about small leakage in the preprocessor: you'd have to
be running some darn big files through it to notice. FTR, here are
the total leaks reported by valgrind for running the ecpg regression
tests, using code like
$ grep lost: *log | tr -d ',' | awk '{sum += $5}
END {print sum}'
Before these patches: 25743
after 0003: 59049363
after 0005: 141556 (this is master now)
after 0006(0001): 132633
after 0007(0002): 9087
after 0008(0003): 0
So clearly, 0003 by itself wasn't good enough, but arguably no
real users will notice the extra inefficiency as of HEAD.
Still, I'd kind of like to get 0007 (now 0002) in there, and
I believe 0006 (0001) is a necessary prerequisite to that.
regards, tom lane
Commits
-
ecpg: clean up some other assorted memory leaks.
- 2b41de4a5b42 18.0 landed
-
ecpg: fix some memory leakage of data-type-related structures.
- 0e6060790d65 18.0 landed
-
ecpg: put all string-valued tokens returned by pgc.l in local storage.
- 85312d95e959 18.0 landed
-
ecpg: fix more minor mishandling of bad input in preprocessor.
- 1fed234f9faf 18.0 landed
-
ecpg: fix some minor mishandling of bad input in preprocessor.
- 9b4bf5169064 18.0 landed
-
ecpg: avoid breaking the IDENT precedence level in two.
- 9812138593f3 18.0 landed
-
ecpg: improve preprocessor's memory management.
- 1acd0f55274f 18.0 landed
-
ecpg: move some functions into a new file ecpg/preproc/util.c.
- f18231e81759 18.0 landed
-
ecpg: re-implement preprocessor's string management.
- a542d5614bdb 18.0 landed
-
ecpg: major cleanup, simplification, and documentation of parse.pl.
- 6b0054994475 18.0 landed
-
ecpg: remove check_rules.pl.
- 293fd24425b5 18.0 landed
-
ecpg: clean up documentation of parse.pl, and add more input checking.
- 00b0e7204d53 18.0 landed
-
Clean up indentation and whitespace inconsistencies in ecpg.
- 97add39c038b 18.0 landed
-
Exclude flex-generated code from coverage testing
- 421167362242 11.0 cited