Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(109)

Issue 6503120: Double size of buffer for SkString::printf() (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 9 months ago by rileya
Modified:
11 years, 9 months ago
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Double size of buffer for SkString::printf() Committed: https://code.google.com/p/skia/source/detail?r=5555

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M src/core/SkString.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3
rileya
The size of this was resulting in cut off results from the pinspect tool, and ...
11 years, 9 months ago (2012-09-14 18:56:18 UTC) #1
reed1
lgtm
11 years, 9 months ago (2012-09-14 19:02:37 UTC) #2
bsalomon
11 years, 9 months ago (2012-09-14 19:03:51 UTC) #3
On 2012/09/14 18:56:18, rileya wrote:
> The size of this was resulting in cut off results from the pinspect tool, and
> since we use SkString::appendf() extensively in shader building, hitting this
> limit on a really long line (unlikely, but still...) could result in incorrect
> shaders.
> 
> That said, I dunno if allocating something this much larger on the stack would
> hurt performance anywhere (esp. on Android).

I once looked into whether there was a way to get vsnprintf to give the buffer
size that would be required to print the whole string. Someone on the Internet
concluded that the only portable way to do it (without parsing the format string
and varargs yourself) was to repeatedly call vsnprintf with larger buffers until
the output size stopped increasing.

LGTM.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b