Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2006-02-10 19:34:33


"Tobias Schwinger" wrote:

> I don't like that 1-hack for the NULL values in offset_ptr
> and I don't understand why it's necessary. If NULL is
> outside the memory segment -- so what? NULL should
> never be dereferenced anyway... There should be
> a "just works" solution and there's no need for
parametrization, here. Maybe I don't understand
> the problem correctly.
>

It is about converting an offset value into pointer.
Offset 0 means that the data didn't move,
their absolute address stayed the same.

Offset 1 meaning always NULL is based on
assumption that no one ever will use
a pointer pointing inside self, to the
second byte of self.

ala

char* p;
p = (char*)&p + 1;

I argue somewhere that this is enough
for absolutely all practical situations and that
other, more complicated types of offset pointer
can be removed from shmem.

/Pavel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk