From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Eliminating grub_size_t
Date: Thu, 03 Jul 2008 15:16:35 -0400 [thread overview]
Message-ID: <1215112595.4585.58.camel@dv> (raw)
In-Reply-To: <486D2358.1030501@nic.fi>
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
next prev parent reply other threads:[~2008-07-03 19:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-02 2:14 Eliminating grub_size_t Pavel Roskin
2008-07-02 2:33 ` Javier Martín
2008-07-02 4:20 ` Pavel Roskin
2008-07-02 10:26 ` Isaac Dupree
2008-07-02 13:23 ` Pavel Roskin
2008-07-02 17:46 ` Vesa Jääskeläinen
2008-07-02 17:51 ` Pavel Roskin
2008-07-03 18:02 ` Marco Gerards
2008-07-03 18:29 ` Pavel Roskin
2008-07-03 18:42 ` Vesa Jääskeläinen
2008-07-03 18:52 ` Pavel Roskin
2008-07-03 19:07 ` Vesa Jääskeläinen
2008-07-03 19:16 ` Pavel Roskin [this message]
2008-07-03 18:56 ` Marco Gerards
2008-07-03 19:05 ` Pavel Roskin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1215112595.4585.58.camel@dv \
--to=proski@gnu.org \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.