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

Unified Diff: src/utils/SkBitSet.h

Issue 2354583002: SkPDF: SkBitSet gets reset() to make drop() better. (Closed)
Patch Set: call destructor directly Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pdf/SkPDFFont.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkBitSet.h
diff --git a/src/utils/SkBitSet.h b/src/utils/SkBitSet.h
index a8585a20b9ea9d30820ca9ad7b3c64d1d5f52bdd..2e2dbebbb277879534692ea5117b30bd451e725e 100644
--- a/src/utils/SkBitSet.h
+++ b/src/utils/SkBitSet.h
@@ -14,9 +14,11 @@
class SkBitSet {
public:
explicit SkBitSet(int numberOfBits) {
- SkASSERT(numberOfBits > 0);
+ SkASSERT(numberOfBits >= 0);
fDwordCount = (numberOfBits + 31) / 32; // Round up size to 32-bit boundary.
- fBitData.reset((uint32_t*)sk_calloc_throw(fDwordCount * sizeof(uint32_t)));
+ if (fDwordCount > 0) {
+ fBitData.reset((uint32_t*)sk_calloc_throw(fDwordCount * sizeof(uint32_t)));
+ }
}
SkBitSet(const SkBitSet&) = delete;
« no previous file with comments | « src/pdf/SkPDFFont.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698