overflow of gReturnValue

Rob Gayvert rtg at rochester.rr.com
Thu Mar 3 14:32:28 UTC 2005


Cees de Groot wrote:

> 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.

> 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.

> 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.




More information about the Wxsqueak mailing list