On Thu, 2008-07-03 at 22:07 +0300, Vesa Jääskeläinen wrote:

> And size_t is kinda connected to memory addresses. Do you agree :) ?

Yes.  However, size_t should hold the maximal structure size, and we can
limit it to 4 (or even 2) gigabytes.  You can think of it as of the size
of a contiguous chunk of memory.  Difference between pointers to
different chunks doesn't have to fit size_t or ptrdiff_t.

Let's see: size_t is used:

in sizeof - OK to limit
in malloc - OK to limit
in strlen - OK to limit
in memcpy - OK to limit
in file I/O - OK to limit

We should not be limiting file and partition sizes and memory addresses,
but it's OK to limit the size of memory that is used at once, including
reading from files.  That's the whole reason why off_t may be longer
than size_t.

-- 
Regards,
Pavel Roskin


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to