Re: typedefs and structs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux