On Sat, Dec 01, 2007 at 12:19:50AM +0100, J.A. Magall??n wrote:This is not what vtables are. Think for a minute - all codepaths arriving to that point in your code will pick the address to call from the same location. Either the contents of that location is constant (in which case you could bloody well call it directly in the first place) *or* it has to somehow be reassigned back and forth, according to the value of this. The former is dumb, the latter - outright insane. The contents of vtables is constant. The whole point of that thing is to deal with the situations where we _can't_ tell which derived class this ->do_something() is from; if we could tell which vtable it is at compile time, we wouldn't need to bother at all. It's a tradeoff - we pay the extra memory access (fetch vtable pointer, then fetch method from vtable) for not having to store a slew of method pointers in each instance of base class. But the extra memory access is very much there. It can be further optimized away if you have several method calls for the same object next to each other (then vtable can be picked once), but it's still done at runtime. -
| Alan | Re: [RFC] Heads up on sys_fallocate() |
| Rafael J. Wysocki | [Bug #11215] INFO: possible recursive locking detected ps2_command |
| Con Kolivas | Re: -mm merge plans for 2.6.23 |
| Mike Galbraith | Re: regression: CD burning (k3b) went broke |
git: | |
| Andy Parkins | svn:externals using git submodules |
| Jeff King | Re: Terminology question about remote branches. |
| Jon Smirl | ! [rejected] master -> master (non-fast forward) |
| Miles Bader | "git pull REMOTE" question |
| Richard Stallman | Real men don't attack straw men |
| Ari Constancio | Re: Squid/authpf with lookups on Active Directory |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Michael | Performance: OpenVPN vs IPsec |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Andrew Morton | Re: [Bugme-new] [Bug 11144] New: dhcp doesn't work with iwl4965 |
| David Miller | Re: xfrm_state locking regression... |
