On Wed, Dec 12, 2001 at 08:15:44AM +0100, Nicolas Aspert wrote:
> Philip Brown wrote:
> > typedef struct _agp_allocate {
> > size_t pg_count; /* number of pages */
> > [Is this really "number of pages", or is it actually
> > "amount of memory"? If really "number of pages",
> > then WHY ISNT IT AN INT?!!]
>
>
> From what is in the code, AFAI understand, this *is* really the number
> of pages. And 'size_t' is nothing but an 'unsigned int' ...
Whether it really is an int underneath, is not the point.
"size_t" should be used for "sizes".
Mostly for BYTE counts of buffers.
eg: read(char *,size_t)
write(char *,size_t)
bcopy (const void *, void *, size_t)
"number of pages" is not a "size". It's a count. Hence it should be
declared as a plain int. Similarly with the other ones in agpgart.
Declaring it as size_t makes it seem like it is the bytecount of all the
pages, rather than a number of pages.
> It looks like every '*_start' field is an adress, while every '*_count'
> is a number of pages...
Thanks. I'll doublecheck that, and then try to keep moving on my driver.
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel