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

Issue 4270041: Correction of SampleApp Windows build-break. (Closed)

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

Description

Correction of the non-portable use of dynamically allocated stack arrays in the pdf shader code. I briefly looked into making use of alloca, but that is also non-portable, and deprecated in many environments. Fell back to the SkTDArray class as a common denominator. This problem was introduce by the following CL: http://codereview.appspot.com/4239061/ Committed: http://code.google.com/p/skia/source/detail?r=912

Patch Set 1 #

Patch Set 2 : Make use of stack-allocating helper-classes. #

Patch Set 3 : Making use of the template-stack-allocating types. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -4 lines) Patch
M src/pdf/SkPDFShader.cpp View 1 2 4 chunks +8 lines, -4 lines 0 comments Download
M vs/SampleApp/SampleApp.vcxproj View 1 chunk +1 line, -0 lines 0 comments Download
M vs/SampleApp/SampleApp.vcxproj.filters View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 4
twiz1
PTAL.
14 years, 3 months ago (2011-03-09 21:43:13 UTC) #1
reed1
SkAutoSMalloc and SkAutoSTMalloc might also be used, as they allow the caller to use the ...
14 years, 3 months ago (2011-03-09 21:57:06 UTC) #2
Steve VanDeBogart
I'd rather use malloc + SkAutoTDelete than SkTDArray because SkTDArray will reserve some space for ...
14 years, 3 months ago (2011-03-09 22:00:15 UTC) #3
twiz1
14 years, 3 months ago (2011-03-09 22:10:03 UTC) #4
On 2011/03/09 21:57:06, reed1 wrote:
> SkAutoSMalloc and SkAutoSTMalloc might also be used, as they allow the caller
to
> use the stack for small requests...
> 
> SkAutoSMalloc<1024> storage(request);
> 
> if request <= 1024, it will be taken from the stack.

I actually had an implementation using those exact classes, but used the array
class because it looked cleaner.  (Fewer reinterpret casts, etc.)

Since you recommend this approach, I'll use those stack-allocating classes.

Jeff
Sign in to reply to this message.

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