diff options
author | 2018-06-07 12:57:05 -0400 | |
---|---|---|
committer | 2018-06-07 20:51:06 +0000 | |
commit | 2e361a3c34dd021f64c51c22fad26a187c436043 (patch) | |
tree | ba4dce6e84184cf6d1660c89d0e72a78cc7270de /include | |
parent | 4d5161135efb96dd6a63fc58567c495e73a17f7d (diff) |
remove unused stat tracking from SkArenaAlloc
I'm really only trying to remove the dependency on SkDebugf().
If we want to keep this, I could switch it to take an optional
stats callback called in the destructor?
Change-Id: I5aa2a58ccc7c8e17e61f29b482b2851be056fa07
Reviewed-on: https://skia-review.googlesource.com/132922
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/private/SkArenaAlloc.h | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/include/private/SkArenaAlloc.h b/include/private/SkArenaAlloc.h index 12f45c9bb3..5646f88daf 100644 --- a/include/private/SkArenaAlloc.h +++ b/include/private/SkArenaAlloc.h @@ -51,25 +51,16 @@ // For arrays of non-POD objects there is a per array overhead of typically 8 bytes. There is an // addition overhead when switching from POD data to non-POD data of typically 8 bytes. // -// You can track memory use by adding SkArenaAlloc::kTrack as the last parameter to any constructor. -// -// char storage[someNumber]; -// SkArenaAlloc alloc{storage, SkArenaAlloc::kTrack}; -// -// This will print out a line for every destructor or reset call that has the total memory -// allocated, the total slop (the unused portion of a block), and the slop of the last block. -// // If additional blocks are needed they are increased exponentially. This strategy bounds the // recursion of the RunDtorsOnBlock to be limited to O(log size-of-memory). Block size grow using // the Fibonacci sequence which means that for 2^32 memory there are 48 allocations, and for 2^48 // there are 71 allocations. class SkArenaAlloc { public: - enum Tracking {kDontTrack, kTrack}; - SkArenaAlloc(char* block, size_t size, size_t, Tracking tracking = kDontTrack); + SkArenaAlloc(char* block, size_t size, size_t); - SkArenaAlloc(size_t extraSize, Tracking tracking = kDontTrack) - : SkArenaAlloc(nullptr, 0, extraSize, tracking) + SkArenaAlloc(size_t extraSize) + : SkArenaAlloc(nullptr, 0, extraSize) {} ~SkArenaAlloc(); @@ -213,10 +204,6 @@ private: const uint32_t fFirstSize; const uint32_t fExtraSize; - // Track some useful stats. Track stats if fTotalSlop is >= 0; - uint32_t fTotalAlloc { 0}; - int32_t fTotalSlop {-1}; - // Use the Fibonacci sequence as the growth factor for block size. The size of the block // allocated is fFib0 * fExtraSize. Using 2 ^ n * fExtraSize had too much slop for Android. uint32_t fFib0 {1}, fFib1 {1}; @@ -227,8 +214,8 @@ private: template <size_t InlineStorageSize> class SkSTArenaAlloc : public SkArenaAlloc { public: - explicit SkSTArenaAlloc(size_t extraSize = InlineStorageSize, Tracking tracking = kDontTrack) - : INHERITED(fInlineStorage, InlineStorageSize, extraSize, tracking) {} + explicit SkSTArenaAlloc(size_t extraSize = InlineStorageSize) + : INHERITED(fInlineStorage, InlineStorageSize, extraSize) {} private: char fInlineStorage[InlineStorageSize]; |