Bug 361707. nsTArray::SetCapacity should return boolean success/failure. r+sr=sicking

This commit is contained in:
roc+%cs.cmu.edu 2006-11-26 22:01:24 +00:00
Родитель cf709a9345
Коммит 4482b64219
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -588,8 +588,9 @@ class nsTArray : public nsTArray_base {
// AppendElement operations to minimize heap re-allocations. This method
// will not reduce the number of elements in this array.
// @param capacity The desired capacity of this array.
void SetCapacity(size_type capacity) {
EnsureCapacity(capacity, sizeof(elem_type));
// @return True if the operation succeeded; false if we ran out of memory
PRBool SetCapacity(size_type capacity) {
return EnsureCapacity(capacity, sizeof(elem_type));
}
// This method modifies the length of the array. If the new length is