Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
EnTerr
Roku Guru

YAWRR: A chess-related death

In today's episode of our award-seeking series "Yet Another Way to Reboot Roku", we have a variation of the ancient "rice and chessboard problem"
s="1": for i=1 to 99: ?i: s=s+s: next

It will pass away quietly at around 27-28. This is one (terminal) way to estimate the amount of free memory.
0 Kudos
4 REPLIES 4
RokuJoel
Binge Watcher

Re: YAWRR: A chess-related death

Nice. Note that on Legacy devices:

Out of Memory when doing string operation. (runtime error &h1a) in ...AA7qjxTe/pkg:/source/test.brs(3)

003: s="1": for i=1 to 99: ?i: s=s+s: next
Backtrace:
Function main() As
file/line: /tmp/plugin/D...AA7qjxTe/pkg:/source/test.brs(3)

Local Variables:
global &h0020 rotINTERFACE:ifGlobal
m &h0010 bsc:roAssociativeArray, refcnt=2
s &h8010 bsc:roString (2.1 was String), refcnt=1
i &h0002 Integer val:27
0 Kudos
EnTerr
Roku Guru

Re: YAWRR: A chess-related death

"RokuJoel" wrote:
Nice. Note that on Legacy devices:
Out of Memory when doing string operation. (runtime error &h1a)
Yep. Olden but golden. "They don't build them like that anymore" 8-)

I can has cheeze-bug-er?
0 Kudos
RokuJoel
Binge Watcher

Re: YAWRR: A chess-related death

I can haz filed bug.

- Joel
0 Kudos
EnTerr
Roku Guru

Re: YAWRR: A chess-related death

gracias!
0 Kudos