On 08/08/2014 16:13, Dimitry Sibiryakov wrote: >> In contrast, last Alex/me solution does not add memory and performance >> problems (each call is a single virtual call) with a check (indirect >> access) for upgrade when a function returns a new object. > Individual function table in every object instance filled on every object > creation you > call "no overhead"?
Where you see individual tables and every-time initialization (you said this before)? Do you know about "static"? Each object has a single pointer pointing to version+functions struct. Version+functions struct exists a single time for each class. They are initialized a single time (and maybe does not even need the if-first, it may be completely static). They may be copied (and cached) if a version is upgraded for a greater version, like current code does manually. Inline dispatchers are inline and optimized by the compiler. This is almost identical to C++ virtual class, and is not subject to future ABI problems. We chose to have a version number in the start. C++ may have something (RTTI) before the vtable address. It's so C++-like, that it even has the C++ "problem" of calling virtual functions in the constructor. >> Even the generated files are not complicated. > Only two levels of nested macros?.. > What macros are you talking about? Adriano ------------------------------------------------------------------------------ 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