On 08/08/2014 07:45, Alex Peshkoff wrote: > On 08/07/14 20:44, Adriano dos Santos Fernandes wrote: >> Attached I put a refinement with: >> - Alex's default base >> - Rename underline to Impl >> - Automatic version check (done only when necessary) > From code I see that it takes place on every invocation of every method. > > I agree that adding ihterface version directly to VT is right solution. > But checking it (yes, fast, yes, inline) in every invocation and > checking so straightforward. Imagine someone compiled old code with new > header, tries to use old fbclient <never calling new methods> and gets > an error in old calls - that's wrong. But I do not see it as a big > problem - it's not hard to add code for version check (and probably > upgrade) in correct places. > Yes, my check was wrong.
Automatic vtable upgrade is ok for me, provided we have a trust-able and reliable way to add them. Attached a demo for it, search for "upgrade". I implemented dummy PluginModule for the demo. It works provided that who called the method that returned the new object was compiled together (or with the same API version) of who is calling the object method. In most of cases I'd imagine, this is true. What do you think? But there may be more cases, like passing a [in]/out parameter, but may be possible in C++. C people and others may use manual upgrade or version check. Adriano
fbinterface-5.tar
Description: Binary data
------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel