On 09/18/2014 12:11 PM, Pascal Obry wrote:
> struct dt_mipmap_buffer_dsc
> {
> uint32_t flags;
> uint32_t height;
> uint32_t size;
> uint32_t width;
>
> uint32_t pad[4]; // comment this out and it is still ok!
> /* NB: sizeof must be a multiple of 4*sizeof(float) */
> } __attribute__((packed));
>
> To me this means that the requirement in comment above is wrong, it
> seems that this record is expected to be EXACTLY 4*sizeof(float).
Hi Pascal,
I'm the original author of the commit where the structure was introduced.
Before my commit, the cache used an array of uint32_t values, totally
undocumented, and for which total "correct" size was unknown.
At the time I introduced the structure, only the flags, height, size,
and width fields existed. It was precisely 4 uint32_t. Hence the code
you found and nicely fixed. This may be me missing those allocation
sites or code added later on, i don't remember
As for the commnt about 4*sizeof(float), iirc, it is about the structure
being at least a SSE register, but i don't remember why... it's like a
2011 commit :-D maybe related to the skull peculiarities
--
Edouard Gomez
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
darktable-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/darktable-devel