Re: Breaking the 10-limit : Problems/Questions for Windows build

Mart Kelder <[email protected]>
Newsgroups gmane.games.torcs.devel
Message-ID <[email protected]>
Hello Jean-Philippe (and others),

Op Sunday 13 April 2008 11:12:30 schreef Annick et Jean-Philippe:
> Hi, Mart, Wolf-Dieter and all.
>
> Even better, may be :
> - again, 2 kinds of modules :
>    * the the current one, with a maximum of 10 interfaces
>    * a new one, with unlimited nb of interfaces
> - the first kind is totally unchanged
> - the second kind keeps its 'extern "C" void <module name>(tModInfo*)'
> entry point, with usual implementation
>    but it has a new 'extern "C" unsigned int <module name>_NbItf()' DLL
> function that simply returns the number of interfaces it publishes
>    (= number of cars for a robot)

I agree that this is a better idea.

> At module load time,
>    1) TGF checks first for the second entry point
>    2) if it finds it, it calls it and get the real number of interfaces
>    3) if it does not find it, it assumes this number is MAX_MOD_ITF (10)
>    4) then it dynamically allocates the array of tModInfo
>       with the determined size, and pass it to the normal entry point
>
> Advantages :
> - no dynamic allocation by the modules => less potential issues with
> alloc/free done with different C libs ...
> - even less changes in robots/modules code
>
> Flaws :
> - ??? => tell me !

I don't see any at the moment.

> Cheers,
>
> Jean-Philippe.

Regards,

Mart

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.