From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KEUIK-0003su-Lu for mharc-grub-devel@gnu.org; Thu, 03 Jul 2008 15:16:40 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEUII-0003sd-Ue for grub-devel@gnu.org; Thu, 03 Jul 2008 15:16:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEUIH-0003sA-4j for grub-devel@gnu.org; Thu, 03 Jul 2008 15:16:38 -0400 Received: from [199.232.76.173] (port=41974 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEUIG-0003s7-VB for grub-devel@gnu.org; Thu, 03 Jul 2008 15:16:36 -0400 Received: from c60.cesmail.net ([216.154.195.49]:53175) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1KEUIG-0004kx-Pz for grub-devel@gnu.org; Thu, 03 Jul 2008 15:16:36 -0400 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 03 Jul 2008 15:16:43 -0400 Received: from [192.168.0.21] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by relay.cesmail.net (Postfix) with ESMTP id EA734618F22 for ; Thu, 3 Jul 2008 15:16:35 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <486D2358.1030501@nic.fi> References: <1214964880.7362.17.camel@dv> <1214966028.9353.95.camel@localhost> <20080702002031.7gkuoel14wg80c0k-cebfxv@webmail.spamcop.net> <486BBEF1.6000105@nic.fi> <1215021108.29069.4.camel@dv> <87bq1e7so2.fsf@xs4all.nl> <1215109795.4585.17.camel@dv> <486D1D8B.6040300@nic.fi> <1215111146.4585.40.camel@dv> <486D2358.1030501@nic.fi> Content-Type: text/plain; charset=ISO-8859-1 Date: Thu, 03 Jul 2008 15:16:35 -0400 Message-Id: <1215112595.4585.58.camel@dv> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 (2.22.2-2.fc9) Content-Transfer-Encoding: 8bit X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: Eliminating grub_size_t X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jul 2008 19:16:39 -0000 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