diff --git a/src/apps/debugger/util/Array.h b/src/apps/debugger/util/Array.h index bb2344c059..f8f3d45bf0 100644 --- a/src/apps/debugger/util/Array.h +++ b/src/apps/debugger/util/Array.h @@ -23,6 +23,7 @@ public: inline Element* Elements() const { return fElements; } inline bool Add(const Element& element); + inline bool AddUninitialized(int elementCount); inline bool Insert(const Element& element, int index); inline bool Remove(int index); @@ -92,6 +93,23 @@ Array::Add(const Element& element) } +template +bool +Array::AddUninitialized(int elementCount) +{ + if (elementCount < 0) + return false; + + if (fSize + elementCount > fCapacity) { + if (!_Resize(fSize, elementCount)) + return false; + } + + fSize += elementCount; + return true; +} + + template bool Array::Insert(const Element& element, int index)