On Wed, Nov 21, 2018 at 07:26:05PM +0200, Gabriel Ivăncescu wrote:
On Wed, Nov 21, 2018 at 7:04 PM Huw Davies huw@codeweavers.com wrote:
Plewase do this. Part of the reason this patch is proving difficult is the messy allocation scheme that already exists. Let's tidy that up first. Everything should fall back to a common allocator, once that's done, it becomes easy to alter the size that that will allocate if we shift to using a byte array for the nodata multiselect case.
The only difference I can see is that the custom allocator deals with sizes in bytes, instead of sizes in "number of items", otherwise there's no way to share it. I'll try something like that, hope that's fine.
The common allocator would take number of items, it would then pass that on to heap_realloc() having done the appropriate multiplication.
We're trying to stop you pulling the nodata stuff into separate functions, but rather use helpers to abstract certain operations (like checking the selected state and allocation). Those helpers will then need to worry about the details.
Well I was trying to abstract the operations also within the helpers (so helpers within helpers!) for NODATA :-) But nevermind.
But you ended up scattering calls to these specialized helpers throughout the code, which resulted in a mess.
Huw.