compat: add fallback implementation for reallocarray(3)

This commit is contained in:
Đoàn Trần Công Danh
2020-09-15 08:21:50 +07:00
parent 175efaff30
commit 50439c9ca9
6 changed files with 30 additions and 5 deletions

View File

@ -293,7 +293,9 @@ sysprof_capture_cursor_add_condition (SysprofCaptureCursor *self,
*
* FIXME: Theres currently no error reporting from this function, so ENOMEM
* results in an abort. */
self->conditions = reallocarray (self->conditions, ++self->n_conditions, sizeof (*self->conditions));
self->conditions = _sysprof_reallocarray (self->conditions,
++self->n_conditions,
sizeof (*self->conditions));
assert (self->conditions != NULL);
self->conditions[self->n_conditions - 1] = sysprof_steal_pointer (&condition);