[openbeos] Re: question about 64-bit processors

  • From: André Braga <meianoite@xxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Fri, 17 Sep 2004 04:28:40 -0300

On Fri, 17 Sep 2004 08:38:14 +0200, Marcus Overhagen <ml@xxxxxxxxxxxx> wrote:
> >    BPointer meaningful_ptr_name1[B_POINTER_SIZE];
> >    BPointer meaningful_ptr_name2[B_POINTER_SIZE];
> 
> You don't seem to understand how pointers are represented by the compiler.

I should have probably have mentioned that BPointer would be a typedef
to char; this would allocate B_POINTER_SIZE bytes of memory. How you
would use those are up to you. Using this space to hold memory
addresses is perfectly possible, doable, and it's nothing short of a
classic technique (classic as in "used by unix IP socket
structures"-classic; namely, sin_zero[] in sockaddr_in, for example).

 
> > //I hope you'll tolerate seing code like this
> No we will not.

Come on! I was being sarcastic...

> You don't seem to understand how pointers are represented by the compiler.
> This doesn't make any sense!

Unless I completely missed it, that's how I imagined Ingo's suggestion
of wrapping those structures around typedefs so it could support
different architectures/pointer widths on compile time.

If I got anything wrong, please enlighten me. I *love* when people
correct me when I'm wrong, but I *hate* being told to shut up,
specially when I'm left ignorant WRT my mistakes.



-- 
"I invented the term Object-Oriented, and I can tell you I did not
have C++ in mind"
Alan Kay

Other related posts: