IRC logs for #openttd.dev on OFTC at 2013-08-04
            
01:24:35 *** frosch123 has quit IRC
07:22:49 *** Zuu has joined #openttd.dev
07:22:49 *** ChanServ sets mode: +v Zuu
08:14:43 *** Supercheese has quit IRC
08:39:37 <fonsinchen> Is it nasty to hijack the "index" field of pool items in order to implement a single linked list on a pool? see http://paste.openttdcoop.org/show/2460/
08:45:26 <fonsinchen> Well, it probably is. I should probably split that in two classes.
08:45:34 <Rubidium> it definitely feels nasty
08:47:15 <Rubidium> and I can quite grasp (quickly) what the heck it's doing
08:48:52 <fonsinchen> I want a single linked list of StationIDs that doesn't allocate any heap if you have only one item
08:49:07 <fonsinchen> And it should have a 16bit "pointer" type
08:49:30 <fonsinchen> So that the thing is 32 bits big and aligns nicely when passed around as value
08:50:14 <Rubidium> but the pool allocates an object for each and every pool element
08:50:31 <fonsinchen> You can put pool items on the stack
08:50:49 <fonsinchen> I have a new idea anyway
08:50:57 <Rubidium> why don't you just use AllocaM?
08:51:07 <fonsinchen> What is that?
08:51:20 <Rubidium> a macro to allocate memory on the stack
08:51:28 <Rubidium> (macro for alloca)
08:51:51 <Rubidium> (behaves just like AllocT, except that it allocates on the stack)
08:52:00 <fonsinchen> Well, if I have multiple items in the list I actually want them to reside on the heap
08:52:18 <fonsinchen> Otherwise I'll be passing around huge arguments on the stack
08:52:49 <Rubidium> can you just pass the pointer to that stack allocated bit? Or does it need to survive longer?
08:52:53 <fonsinchen> The point of it is to properly support conditional orders when predicting next hops
08:53:07 <fonsinchen> A pointer is rather large
08:53:39 <Rubidium> if you allocate an object on the heap you use at least a few size_t worth of memory anyway
08:54:11 <fonsinchen> The heap allocation should only happen if there are conditional orders. Thus it should be rare
08:54:21 <fonsinchen> In comparison to just passing a single value around
08:55:01 <fonsinchen> This is why I'm trying to optimize it for the single value case and why I'm trying to bitstuff it into 32 bits
08:55:55 <fonsinchen> And usually the whole thing will be returned from functions. So allocating on the stack is probably not so clever.
08:58:26 <fonsinchen> Well, I'll just make a base class without pool and another derived class with pool. The latter doesn't have to align and is only used if there are multiple values.
09:00:24 *** Ristovski has joined #openttd.dev
09:13:24 *** ntoskrnl has joined #openttd.dev
09:17:47 <fonsinchen> Shorter, better and no index hijacking: http://paste.openttdcoop.org/show/2461/
09:18:57 <fonsinchen> Oh, one can make it even shorter ...
09:21:56 *** frosch123 has joined #openttd.dev
09:21:56 *** ChanServ sets mode: +v frosch123
09:27:36 <fonsinchen> Maybe that wants to be a general "SmallStack"
10:32:14 *** Zuu has quit IRC
11:51:24 <frosch123> http://devs.openttd.org/~frosch/diffs/fs5669.diff
11:52:02 <frosch123> invalidate vehicle sprite and colourmap whenever (un)loading cargo, and also in some corner cases more
11:52:27 <frosch123> generally the invalidation of the colourmap was weird before, since it did not trigger redrawing of the vehicle
12:21:47 <Rubidium> seems to be okay
12:21:57 <Rubidium> can vehicles get their current palette though?
12:22:15 <Rubidium> in e.g. the vehicle's age property?
13:03:36 <frosch123> vehicle age?
13:03:52 <frosch123> nothing depends on the palette
13:04:00 <Rubidium> aging ;)
13:04:09 <frosch123> it's client specific anyway, due to the company colour of opponents setting
13:05:44 <Rubidium> hmm, good point
14:02:28 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r25648 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking"
14:43:49 *** Zuu has joined #openttd.dev
14:43:49 *** ChanServ sets mode: +v Zuu
15:16:27 *** LordAro has joined #openttd.dev
15:16:27 *** ChanServ sets mode: +v LordAro
17:45:10 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r25649 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking"
18:24:36 *** Alberth has joined #openttd.dev
18:24:36 *** ChanServ sets mode: +v Alberth
19:16:32 *** ntoskrnl has quit IRC
19:24:50 *** Alberth has left #openttd.dev
20:35:05 *** frosch123 has quit IRC
20:51:05 *** Supercheese has joined #openttd.dev
22:20:41 *** Zuu has quit IRC
23:10:24 *** Ristovski has quit IRC