Discussion:
overflow of gReturnValue
Cees de Groot
2006-07-19 15:18:01 UTC
Permalink
Hi,

I found out why playing Gremlin on the tree control crashes at times -
Squeak code doesn't get a chance of fetching return values, and this
overflows gReturnValue.

In my custom build, I increased the size of the array to 1000 instead of
10, hoping that my users don't have the stamina to keep clicking around
like wild monkeys for such a long time. However, I feel a more permantent
fix is in order (maybe dynamic growing/shrinking of the array - we're
living in 'user time' in this code, so the performance hit of using
something more advanced than an unchecked array won't be that large, I
think)...

On a related note: shouldn't the set/getReturnValue code belong in a
critical section? Or is everything with wx still handled in a single
native thread?
Rob Gayvert
2006-07-19 15:18:01 UTC
Permalink
Post by Cees de Groot
I found out why playing Gremlin on the tree control crashes at times
- Squeak code doesn't get a chance of fetching return values, and
this overflows gReturnValue.
Ouch. Obviously, I never contemplated this growing so large.
Post by Cees de Groot
In my custom build, I increased the size of the array to 1000 instead
of 10, hoping that my users don't have the stamina to keep clicking
around like wild monkeys for such a long time. However, I feel a more
permantent fix is in order (maybe dynamic growing/shrinking of the
array - we're living in 'user time' in this code, so the performance
hit of using something more advanced than an unchecked array won't be
that large, I think)...
Agreed. I should be using some flavor or wxArray or wxList here.
Post by Cees de Groot
On a related note: shouldn't the set/getReturnValue code belong in a
critical section? Or is everything with wx still handled in a single
native thread?
AFAIK, everything happens in one thread as far as we're concerned. The
whole set/getReturnValue business is a hack, necessitated by the fact
that re-entrant calls to interpret() sometimes mess up primitive return
values. I hope to eventually clean this up.

Loading...