Skip to content

vulkan: STACK_ARRAY tweaks

Paulo Zanoni requested to merge pzanoni/mesa:vulkan-stack-array into main

I was recently asked to use STACK_ARRAY in a patch and started reflecting on its current state. I came up with a bug fix and a few improvement suggestions. I'm not sure every change here is actually desirable, but I guess an MR is a great way to start the discussion. Feel free to NACK the patches you don't think are worth merging. In summary we have:

  1. Fix potential leak.
  2. Don't 0-init everybody.
  3. Switch to alloca().
  4. Change the threshold to bytes instead of elements
  5. Make it warn when we forget the finish function.
  6. Move to src/util.

Merge request reports