LWN.net Logo

When in doubt, add another layer of indirection

When in doubt, add another layer of indirection

Posted Jun 3, 2011 9:04 UTC (Fri) by jengelh (subscriber, #33263)
In reply to: When in doubt, add another layer of indirection by sethml
Parent article: Object-oriented design patterns in the kernel, part 1

But the 52 saved bits might be spent again in extra instructions to calculate the pointer from the extra offset that you then would have.


(Log in to post comments)

When in doubt, add another layer of indirection

Posted Jun 3, 2011 12:15 UTC (Fri) by dlang (✭ supporter ✭, #313) [Link]

but if you have thousands or millions of these in memory the space savings may add up

also, since the cpu runs so much faster than memory does, you can actually do quite a lot of processing in the time saved by avoiding a memory fetch.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds