[vlc-devel] [PATCH] Make cached module configuration on 64 bits work again

Rafaël Carré funman at videolan.org
Thu Jan 24 22:53:21 CET 2013


Le 24/01/2013 22:15, Mario Speiß a écrit :
> On 24.01.2013 14:27, Rafaël Carré wrote:
>> Hello,
>>
>> Le 24/01/2013 08:19, Mario Speiß a écrit :
>>> This patch resolves the problems I encountered after applying the patch
>>> for src/modules/cache.c with the 64 bit version of vlc.
>>>
>>> The structure is 64 bit large but the cached module configuration was
>>> fed with the lower 32 bits only.
>>
>> Why "the lower 32 bits only" ?
> 
> The lower 32 bits only are saved to and loaded from plugins.dat from 
> src/modules/cache.c with "SAVE/LOAD_IMMEDIATE (cfg->flags);", as 
> sizeof(cfg->flags) is four only 32 bits are saved/loaded. That was the 
> reason to make cfg->flags large enough on 64 bits to contain the whole 
> union.
> Another approach could be to name the union and instead 
> SAVE/LOAD_IMMEDIATE(cfg->'union').
> 
> The patch i think seems least interfering with other vlc api as the 
> union/structure in memory is *not* affected. As i wrote before, all the 
> "misterious" bugs i mentioned disappeared and i did *not* experience any 
> further implications.

Ok I think I understand the problem now.

What do you think of removing bitfields altogether?
We would replace it by a fixed length 'flags' (uint8_t for example) and
use "flags & (1<<FLAG_FOO)" instead.

That would need a bit more work of course.



More information about the vlc-devel mailing list