We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8d2d55 commit 0402360Copy full SHA for 0402360
src/rt/util/array_list.h
@@ -72,8 +72,10 @@ array_list<T>::push(T value) {
72
if (_size == _capacity) {
73
size_t new_capacity = _capacity * 2;
74
void* buffer = realloc(_data, new_capacity * sizeof(T));
75
- if (buffer == NULL)
76
- throw std::bad_alloc();
+ if (buffer == NULL) {
+ fprintf(stderr, "array_list::push> Out of memory allocating %ld bytes", new_capacity * sizeof(T));
77
+ abort();
78
+ }
79
_data = (T *) buffer;
80
_capacity = new_capacity;
81
}
0 commit comments