|
From: Mart K. <ma...@ke...> - 2008-05-04 09:44:22
|
Hi Jean-Philippe, Op Thursday 01 May 2008 21:34:40 schreef Annick et Jean-Philippe: > Hi, Mart, and all. > > This is a new version of the second half > of the "no maximum number of interfaces for Torcs modules" patch. > > It fixes the issues you detected in linux/windowsModLoad function : > > - if the module is already present in the modlist, it is not reloaded, > BUT the associated modlist item is moved to the head of the list > (raceinit.cpp needs that, and the lack of it in previous version > DID really lead to bad car<->robot assignements in certain cases > like the following racing driver list: bt 1, inferno 2, bt 4 > => inferno 4 robot/car used in place of bt 2) > Moreover, even if linux/windowsModInfo is never used, I made the same > fix in it and also removed the priority sorting while adding the modinfo > item (this was a bug, wasn't it ?), to be fully consistent. linuxModInfo is a variant of linuxModInfoDir, which is used when creating the list of available robots (so you can select the robots you want to race against). So I think the robot priority can be used to place your own robot higher in the list such that it is easier to select it. I don't know if it is actually used. > - added documentation about the fact that modules are not reloaded > if already present in the list WITH EQUAL SOPATH, but are reloaded > each time a different sopath is used for the associated library > (ex: relative and absolute one). As far as I can see, this is sufficient > in current torcs code to avoid loading twice the same module ... > > About the calloc check (does it return 0 ?), I did not change anything, > but I'm open to any suggestion. If calloc returns 0, then both the RAM memory and the swap memory (if available) is full. It usually causes X (in Linux) to be very slow. So Torcs isn't playable at all. So the memory of Torcs can better be used to kill the program what causes the memory leak (if that doesn't kill itself), in my opinion. > Regards, > > Jean-Philippe. > > PS: Tested on Linux Mandriva 2008.0 GCC 4.2.2 rc x86_64 > and Windows XP SP2 VC6 SP6 Regards, Mart |