diff --git a/src/apps/debugger/Array.h b/src/apps/debugger/Array.h index 09d1646150..ba6dd180d3 100644 --- a/src/apps/debugger/Array.h +++ b/src/apps/debugger/Array.h @@ -25,6 +25,9 @@ public: inline bool Insert(const Element& element, int index); inline bool Remove(int index); + void Clear(); + inline void MakeEmpty(); + inline Element& ElementAt(int index); inline const Element& ElementAt(int index) const; @@ -119,6 +122,29 @@ Array::Remove(int index) } +template +void +Array::Clear() +{ + if (fSize == 0) + return; + + free(fElements); + + fElements = NULL; + fSize = 0; + fCapacity = 0; +} + + +template +void +Array::MakeEmpty() +{ + Clear(); +} + + template Element& Array::ElementAt(int index)