diff options
Diffstat (limited to 'include/private/SkTArray.h')
-rw-r--r-- | include/private/SkTArray.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/private/SkTArray.h b/include/private/SkTArray.h index 55d4f86aaa..1fe2c3857c 100644 --- a/include/private/SkTArray.h +++ b/include/private/SkTArray.h @@ -121,6 +121,15 @@ public: } /** + * Ensures there is enough reserved space for n elements. + */ + void reserve(int n) { + if (fCount < n) { + this->checkRealloc(n - fCount); + } + } + + /** * Resets to a copy of a C array. */ void reset(const T* array, int count) { |