commit | a5aaa7998fc18489701660f781d7daa33ffc6f6e | [log] [tgz] |
---|---|---|
author | edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | Thu Jul 11 12:27:21 2013 +0000 |
committer | edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | Thu Jul 11 12:27:21 2013 +0000 |
tree | 077fa0caab099734a3942dd159bd8e2568a39e7a | |
parent | 76d119279e4f1df5dbcd28299fbc5941faf7f5d0 [diff] [blame] |
pdfviewer: measure mem usage, command line flags library. Review URL: https://codereview.chromium.org/18562010 git-svn-id: http://skia.googlecode.com/svn/trunk@9996 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.h b/experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.h index 333d9dc..f544ff3 100644 --- a/experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.h +++ b/experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.h
@@ -83,9 +83,11 @@ int fCurrentUsed; SkPdfObject* allocBlock(); + size_t fSizeInBytes; public: SkPdfAllocator() { + fSizeInBytes = sizeof(*this); fCurrent = allocBlock(); fCurrentUsed = 0; } @@ -98,8 +100,13 @@ void* alloc(size_t bytes) { void* data = malloc(bytes); fHandles.push(data); + fSizeInBytes += bytes; return data; } + + size_t bytesUsed() { + return fSizeInBytes; + } }; class SkNativeParsedPDF;