git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: tboegi@web.de, git@vger.kernel.org
Subject: Re: [PATCH v2 1/1] Use size_t instead of 'unsigned long' for data in memory
Date: Wed, 21 Nov 2018 06:55:15 -0500	[thread overview]
Message-ID: <17c472c4-34be-390d-947f-ff998398295c@gmail.com> (raw)
In-Reply-To: <20181120050456.16715-1-tboegi@web.de>

On 11/20/2018 12:04 AM, tboegi@web.de wrote:
> From: Torsten Bögershausen <tboegi@web.de>
>
> Currently the length of data which is stored in memory is stored
> in "unsigned long" at many places in the code base.
> This is OK when both "unsigned long" and size_t are 32 bits,
> (and is OK when both are 64 bits).
> On a 64 bit Windows system am "unsigned long" is 32 bit, and
> that may be too short to measure the size of objects in memory,
> a size_t is the natural choice.

Is this change enough to store 4GB files on Windows? Or is there more to 
do?

> Thanks for all the comments on V1.
> Changes since V1:
> - Make the motivation somewhat clearer in the commit message
> - Rebase to the November 19 pu
>
> What we really need for this patch to fly are this branches:
> mk/use-size-t-in-zlib
> tb/print-size-t-with-uintmax-format

I believe communicating these direct dependencies is the correct way to 
go, and the rebase you mentioned is unnecessary (instead, test with a 
merge).

Hopefully the patch applies on top of a merge of those branches.

> @@ -529,7 +530,7 @@ static void *unpack_raw_entry(struct object_entry *obj,
>   }
>   
>   static void *unpack_data(struct object_entry *obj,
> -			 int (*consume)(const unsigned char *, unsigned long, void *),
> +			 int (*consume)(const unsigned char *, size_t, void *),
>   			 void *cb_data)

This is the only instance that is not paired directly with a variable 
name like "size", "sz", or "len". However, it appears to be correct from 
context.

Thanks for this!

Reviewed-by: Derrick Stolee <dstolee@microsoft.com>


  reply	other threads:[~2018-11-21 11:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-17 15:11 [PATCH/RFC v1 1/1] Use size_t instead of unsigned long tboegi
2018-11-18 20:18 ` Derrick Stolee
2018-11-18 23:40   ` Junio C Hamano
2018-11-19  5:33     ` Torsten Bögershausen
2018-11-19 18:15       ` René Scharfe
2018-11-19 16:33   ` Torsten Bögershausen
2018-11-20  1:36     ` Junio C Hamano
2018-11-20  5:04 ` [PATCH v2 1/1] Use size_t instead of 'unsigned long' for data in memory tboegi
2018-11-21 11:55   ` Derrick Stolee [this message]
2019-01-16 21:46   ` Thomas Braun
2019-01-19 17:06     ` Torsten Bögershausen
2019-01-22 14:25       ` Thomas Braun
2019-04-13 15:18 ` [PATCH v3 " tboegi

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17c472c4-34be-390d-947f-ff998398295c@gmail.com \
    --to=stolee@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=tboegi@web.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).