The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: yoshi on March 22, 2009, 11:22:39 AM

Title: Warning to overflow of convoi IDs
Post by: yoshi on March 22, 2009, 11:22:39 AM
I realised that there is no warning to the overflow of convoi IDs. When I tried to buy 8193rd convoi (under the default setting i.e. convoys = 8192), Simutrans just shut down. It would be good if there is a warning message, if you tried to buy 8193rd convoi...
Title: Re: Warning to overflow of convoi IDs
Post by: whoami on March 22, 2009, 07:31:18 PM
Quote from: yoshi on March 22, 2009, 11:22:39 AM
Simutrans just shut down.
So this is a bug => topic moved.
Title: Re: Warning to overflow of convoi IDs
Post by: Isaac Eiland-Hall on March 22, 2009, 09:33:14 PM
A map with 8192 convoys...... holy. cow. :D

EDIT: WAit.. wait... wait... A map with 8192 convoys - AND YOU STILL NEED MORE. Good grief! (I'm just amazed... hehehehe)
Title: Re: Warning to overflow of convoi IDs
Post by: prissi on March 23, 2009, 02:22:36 PM
well, mazbe the default should be 32760 anyway ...

But a warning is possible. Same would go for just denz buzing a new one.
Title: Re: Warning to overflow of convoi IDs
Post by: vilvoh on March 23, 2009, 02:36:43 PM
What about this one with the following sentence.... ::)

(http://www.postimage.org/Pq2u5ERA.jpg) (http://www.postimage.org/image.php?v=Pq2u5ERA)
Leave the convoys alone, now!!!

Edit: sentence modified.
Title: Re: Warning to overflow of convoi IDs
Post by: VS on March 23, 2009, 03:20:37 PM
Vilvoh, just so that you know: that could be easily interpreted as insulting (at least I can imagine that instantly).

How much memory does that value eat anyway? 8B per item when aligned?
Title: Re: Warning to overflow of convoi IDs
Post by: Spike on March 23, 2009, 03:53:11 PM
Quote from: VS on March 23, 2009, 03:20:37 PM
How much memory does that value eat anyway? 8B per item when aligned?

4, i think. It's just a table of pointers, which is used to implement the "tombstone" pattern to have checkable pointers (checkable if the object in question still exists).

http://en.wikipedia.org/wiki/Tombstone_(programming)

Edit:

If someone ever wondered what "quickstones" are, that's been a modification of this pattern, which is supposed to be faster. No idea if this is still in the current Simutrans code, but it was when I left it.

Title: Re: Warning to overflow of convoi IDs
Post by: jamespetts on March 23, 2009, 04:24:40 PM
Quickstones are indeed used heavily in the current Simutrans code.
Title: Re: Warning to overflow of convoi IDs
Post by: prissi on March 24, 2009, 12:18:27 PM
THe new code will extend to 65530 and give a warning (and no new convoi) when handles are exceeded. Meaning the values will be gone from configuration files soon.
Title: Re: Warning to overflow of convoi IDs
Post by: yoshi on March 24, 2009, 12:40:49 PM
Oh, thank you very much for your prompt work!