typedefs and structs

thockin at hockin.org thockin at hockin.org
Thu Nov 10 06:36:25 EST 2005


On Wed, Nov 09, 2005 at 01:20:28PM -0600, linas wrote:
> I guess the real point that I'd wanted to make, and seems
> to have gotten lost, was that by avoiding using pointers, 
> you end up designing code in a very different way, and you
> can find out that often/usually, you don't need structs
> filled with a zoo of pointers.

Umm, references are implemented as pointers.  Instead of a "zoo of
pointers" you have a "zoo of references".  No functional difference.

> Minimizing pointers is good: less ref counting is needed,
> fewer mallocs are needed, fewer locks are needed 
> (because of local/private scope!!), and null pointer 
> deref errors are less likely. 

Not true at all!  If you're storing references you absolutley still need
reference counting.  Allocation non-trivial things on the stack is Bad
Idea in kernel land.




More information about the Linuxppc64-dev mailing list