Commit 8378a786 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Use wined3d_array_reserve() to pre-allocate the buffer dirty ranges array.

parent 352d0493
......@@ -1399,7 +1399,8 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d
return E_OUTOFMEMORY;
}
if (!(buffer->dirty_ranges = heap_alloc(sizeof(*buffer->dirty_ranges))))
if (!wined3d_array_reserve((void **)&buffer->dirty_ranges,
&buffer->dirty_ranges_capacity, 1, sizeof(*buffer->dirty_ranges)))
{
ERR("Out of memory.\n");
buffer_resource_unload(resource);
......@@ -1407,7 +1408,6 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d
wined3d_resource_wait_idle(resource);
return E_OUTOFMEMORY;
}
buffer->dirty_ranges_capacity = 1;
if (buffer->locations & WINED3D_LOCATION_DISCARDED)
buffer->resource.client.addr.buffer_object = CLIENT_BO_DISCARDED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment