[PATCH 7/9] wined3d: Make device palettes dynamically allocated.

Alexandre Julliard julliard at winehq.org
Tue Mar 25 05:57:13 CDT 2008


Alexander Dorofeyev <alexd4 at inbox.lv> writes:

> +    if (PaletteNumber >= This->NumberOfPalettes) {
> +        NewSize = This->NumberOfPalettes;
> +        do {
> +           NewSize *= 2;
> +        } while(PaletteNumber >= NewSize);
> +        palettes = HeapReAlloc(GetProcessHeap(), 0, This->palettes, sizeof(PALETTEENTRY[256]) * NewSize);

You should be using an array of pointers, not a single array for all
palettes, so that you don't need to move around the whole data on each
realloc.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list