ralphy wrote: 
> 
> Perhap changing the lua default integer type to 64bit by changing
> LUA_NUMBER_MODE to 22 making the lua integer type a long long.
> https://github.com/Logitech/squeezep.../luaconf.h#L24
> Need to confirm the LUAI_BITSINT definitions as well. I confirmed that a
> long long is 8 bytes on the radio. This could have a negative impact on
> available memory in the radio.
> 

This might deal with the annoyance of having negative valued jiffies in
lua code. It might even double the "reboot" period:

Code:
--------------------
    
  int jiveL_get_ticks(lua_State *L) {
        lua_pushnumber(L, (LUA_NUMBER) jive_jiffies());
        return 1;
  }
  
--------------------

It would avoid changing the LUA_NUMBER_MODE, and possibly impacting
something else. -LUA_NUMBER- is also defined in -luaconf.h-, I'm pretty
sure the Radio, and all SqueezePlay, is using 'double', but needs
checking. I'm never sure whether I get casts/conversions right...

ralphy wrote: 
> 
> SDL_GetTicks is called directly only in jiveblit.c which is easy to fix
> but jive_jiffies is used a lot and in many cases expected to be only
> 32bits.
> 

Most of the time 32 bits must be just fine, because working MOD
(u32_MAX+1) should be just fine unless the relevant jiffies more than 48
days apart. Provide the code sticks to subtraction and not straight
magnitude comparison. I think. Need to check against concrete example.

ralphy wrote: 
> I would think using a double to have a bigger performance impact on the
> radio than a 64bit int since it uses emulated floating point.  Need to
> try it to be sure.  If changing LUA_NUMBER_MODE doesn't work.
But I think that it is already using -double- as a lua number type. Or
is lua being rather more subtle that I imagine ? I was thinking that
that lua simply converts an integer to a double anyway, all the time. I
may be wrong.


As regards 'a better way', I am getting the feeling that checking for
wrap around might actually not be too onerous an approach. Would add
some element of 'complexity' to the look of the code. There's a lot of
places to examine, though.


------------------------------------------------------------------------
mrw's Profile: http://forums.slimdevices.com/member.php?userid=38299
View this thread: http://forums.slimdevices.com/showthread.php?t=111663

_______________________________________________
Radio mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/radio

Reply via email to