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

Re: [Xen-devel] RFC: vaddr_t and vsize_t



On Wednesday 17 January 2007 16:49, Keir Fraser wrote:
> On 17/1/07 15:17, "Christoph Egger" <Christoph.Egger@xxxxxxx> wrote:
> > vaddr_t is used when a virtual address is meant. It is an unsigned
> > integer and its size always matches sizeof(void *).
> > vsize_t is used when the virtual address space is meant. It is an
> > unsigned integer and its size always matches the whole size of the
> > virtual address space.
>
> Is this distinction ever useful?

As long as no architecture is added to Xen which uses ILP rather LP64,
vsize_t is not really needed. For vaddr_t see below.

> The assumption that a pointer fits in a long is rather ingrained into Xen's
> code base. Any attempt to remove that assumption is going to need some big
> patches, and it's really not clear that we ought to care as I'm sure it's
> true for any architecture we can conceive of caring one jot about.

Once an ILP arch comes up, the assumption is no longer true. Until this 
happens, noone need to care.

This stuff is about removing a place where programmers can make mistakes.
vaddr_t also avoids void * arithmetics. It should be possible then to use 
-Wpointer-arith.

I don't mind if you dislike vsize_t for the above reason. What do you think
about vaddr_t?

Christoph





_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.