Index: include/core/SkTDArray.h |
diff --git a/include/core/SkTDArray.h b/include/core/SkTDArray.h |
index 92f297c31a63f6a2f0c927f01c2db5ac6f69215e..8e8b4923e3e91d707cb1d2f3ba59be53fe08627c 100644 |
--- a/include/core/SkTDArray.h |
+++ b/include/core/SkTDArray.h |
@@ -347,6 +347,11 @@ public: |
} |
#endif |
+ void shrinkToFit() { |
+ fReserve = fCount; |
+ fArray = (T*)sk_realloc_throw(fArray, fReserve * sizeof(T)); |
+ } |
+ |
private: |
#ifdef SK_DEBUG |
enum { |