Summary: | [patch] reduce use of gmalloc() in GooString::appendfv() | ||
---|---|---|---|
Product: | poppler | Reporter: | William Bader <williambader> |
Component: | general | Assignee: | poppler-bugs <poppler-bugs> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | williambader |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
patch to GooString::appendfv()
patch to the patch |
Description
William Bader
2015-02-12 04:04:02 UTC
Can you attach one file you used to test this ? I put my copy of the file at http://williambader.com/2-DESCR_648853-IT-EN-DE_MANITOU_RIGENERATO.pdf pdftops has to write a lot of formatted strings, especially for PDFs that draw a lot of lines. I think that the calls to write formatted strings (which end up as calls to appendfv()) are necessary. My patch just saves appendfv() from making a malloc call for a small, fixed size chunk of memory each time that it is called. In the test file, all of the calls have 8 arguments or less, and appendfv() never needs to reallocate the argument buffer. Ok, the code is not much harder to read so if noone disagrees i'll commit it next week. (In reply to Albert Astals Cid from comment #3) > Ok, the code is not much harder to read so if noone disagrees i'll commit it > next week. LGTM Pushed Created attachment 113584 [details] [review] patch to the patch When I looked at the copy of the patch in the email, I noticed that the memcpy() length needs to be multiplied by sizeof(GooStringFormatArg) |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.