On 20 August 2013 12:07, Stefan Dösinger stefan@codeweavers.com wrote:
+void *wined3d_alloc_resource_mem(SIZE_T size) +{
- void **p;
- SIZE_T align = RESOURCE_ALIGNMENT - 1 + sizeof(*p);
- void *mem;
- if (!(mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + align)))
return NULL;
- p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1;
- *p = mem;
- return ++p;
+}
I think this should either be called wined3d_resource_allocate_sysmem() and live in resource.c, or accept any np2 alignment and be called something along the lines of wined3d_memalign(). The former probably makes the most sense at this point.
Somewhat related, I don't think there's really a reason to have both "allocatedMemory" and "heap_memory" anymore. It should probably just be called "sysmem". That's a cleanup that doesn't necessarily belong in this patch though.