Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Issue 433463003: Fix way-over-allocation in pipe. (Closed)

Created:
6 years, 4 months ago by mtklein_C
Modified:
6 years, 4 months ago
Reviewers:
Tom Hudson, tomhudson
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Fix way-over-allocation in pipe. https://codereview.chromium.org/283093002 fixed some bugs in pipe memory allocation, but also introduced one of its own: nearly every block requested from needOpBytes() got its own 16K allocation. The correct logic is to take the requested size, add four more bytes for a DrawOp, make sure that's 4-byte aligned, then check to see if there's enough space for that in the current block. If there's not, allocate at least MIN_BLOCK_SIZE bytes to fit the request. The bug is that I moved that round-up-to-MIN_BLOCK_SIZE step before checking for space in the current block. This means most (all?) blocks will be 16K but never seem to have room to fit another allocation. You need 8 bytes? You get 16K. You need 8 more bytes? Nope, can't fit that. Here's a new 16K... This reverts the change to the test I made then, which really should have tipped me off. It was testing exactly this bug. BUG=372671 Committed: https://skia.googlesource.com/skia/+/6d88e6ce51ff34c99a1135161f06f29322f58e5a

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -5 lines) Patch
M src/pipe/SkGPipeWrite.cpp View 1 chunk +5 lines, -3 lines 0 comments Download
M tests/DeferredCanvasTest.cpp View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
mtklein_C
6 years, 4 months ago (2014-07-30 16:05:09 UTC) #1
tomhudson
lgtm
6 years, 4 months ago (2014-07-30 16:06:38 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/mtklein@chromium.org/433463003/1
6 years, 4 months ago (2014-07-30 16:07:20 UTC) #3
commit-bot: I haz the power
6 years, 4 months ago (2014-07-30 16:18:01 UTC) #4
Message was sent while issue was closed.
Change committed as 6d88e6ce51ff34c99a1135161f06f29322f58e5a

Powered by Google App Engine
This is Rietveld 408576698