[PATCH 2/4] winevulkan: Replace temp heap_allocs with alloca

Matteo Bruni matteo.mystral at gmail.com
Fri Mar 6 04:08:38 CST 2020

On Thu, Mar 5, 2020 at 9:26 PM Andrew Wesie <awesie at gmail.com> wrote:
> On Thu, Mar 5, 2020 at 11:03 AM Joshua Ashton <joshua at froggi.es> wrote:
> >
> > This allocates these structs and arrays of structures on the stack instead of the heap (which is expensive and takes time!)
> >
> > These structures and arrays of structures are small, and this is all super duper hot path code.
> >
> Would it make sense to keep the heap allocation as a slow-path if the
> assumption about the allocation size is wrong? For example, if count
> is less than 32 use alloca(), otherwise use the heap to avoid a stack
> overflow.

Or even use a fixed-size stack array in the "small" case to avoid
alloca() entirely.

More information about the wine-devel mailing list