Am Mittwoch, 13. Juni 2007 schrieb [EMAIL PROTECTED]: > On Mon, 11 Jun 2007 16:45:58 -0400 Dennis Schridde > >Valgrind should help... Will try on the weekend. > > > >You apparently dove deep into the code and found several places > >where > >unitialised memory comes from or pointers are not set to NULL. > >Maybe you can > >create a list? (variablename, file, line) > > Create list of all variables that crash on? > It looks to me this is most for droids. (target/sound/and so ) > I think, could be best is when droid is made, put this into global > (linked list?) list. Then on droid dead, we clear entry in list. > Then before all calls that have to use droid data, we check if > match on global list. If yes, then continue. If no, then abort > out of routine. This list may be, 300 units (max?) for each > player. > > I thinks this will works OK. Maybe have to do this for all other > types units/buildings also? I am not sure whether I understood you correctly, in case you want an "alive-list" with all droids being alive and before using any pointer, walk the list to see whether it is in that list, is maybe a good idea, and maybe not.
Our thoughts about this on IRC were as follows: - Walking a long list with all units in it is slooow. Walking this list before dereferencing any pointer is possibly even slower. - Dead-lists (prune-lists, as they are called in WZ according to Per) are probably better to walk, because they usually are shorter. - Refcounting is probably even better. - Fully ID based system is another option, but maybe too slow. It could be speed up by "caching" the pointer in case you can ensure that you don't destroy the droid while the function (...) runs. This needs some work of the user (of the ID system), though. --Dennis
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Warzone-dev mailing list Warzone-dev@gna.org https://mail.gna.org/listinfo/warzone-dev