192 // Does nothing for resource and arena objects |
192 // Does nothing for resource and arena objects |
193 ~GrowableArray() { if (on_C_heap()) clear_and_deallocate(); } |
193 ~GrowableArray() { if (on_C_heap()) clear_and_deallocate(); } |
194 |
194 |
195 void clear() { _len = 0; } |
195 void clear() { _len = 0; } |
196 int length() const { return _len; } |
196 int length() const { return _len; } |
|
197 int max_length() const { return _max; } |
197 void trunc_to(int l) { assert(l <= _len,"cannot increase length"); _len = l; } |
198 void trunc_to(int l) { assert(l <= _len,"cannot increase length"); _len = l; } |
198 bool is_empty() const { return _len == 0; } |
199 bool is_empty() const { return _len == 0; } |
199 bool is_nonempty() const { return _len != 0; } |
200 bool is_nonempty() const { return _len != 0; } |
200 bool is_full() const { return _len == _max; } |
201 bool is_full() const { return _len == _max; } |
201 DEBUG_ONLY(E* data_addr() const { return _data; }) |
202 DEBUG_ONLY(E* data_addr() const { return _data; }) |