public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Steffen Prohaska <prohaska@zib•de>
Cc: Git Mailing List <git@vger•kernel.org>, Jeff King <peff@peff•net>,
	pclouds@gmail•com, john@keeping•me.uk, schacon@gmail•com
Subject: Re: [PATCH v3 2/3] Introduce GIT_MMAP_LIMIT to allow testing expected mmap size
Date: Fri, 22 Aug 2014 09:31:29 -0700	[thread overview]
Message-ID: <xmqqiolkpjtq.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <xmqqmwawpldt.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Fri, 22 Aug 2014 08:57:50 -0700")

Junio C Hamano <gitster@pobox•com> writes:

> Steffen Prohaska <prohaska@zib•de> writes:
>
>>>> +	if (limit == -1) {
>>>> +		const char *env = getenv("GIT_MMAP_LIMIT");
>>>> +		limit = env ? atoi(env) * 1024 : 0;
>>
>> ... this should then be changed to atol(env), and ... 
>
> In the real codepath (not debugging aid like this) we try to avoid
> atoi/atol so that we can catch errors like feeding "123Q" and
> parsing it as 123.

Sorry for hitting <SEND> by mistake before finishing the paragraph,
which should have concluded with:

    But it is OK to be loose in an debugging aid.  If I were doing
    this code, I actually would call git_parse_ulong() and not
    define it in terms of kilobytes, though.

  reply	other threads:[~2014-08-22 16:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 16:05 [PATCH v3 0/3] Stream fd to clean filter, GIT_MMAP_LIMIT Steffen Prohaska
2014-08-21 16:05 ` [PATCH v3 1/3] convert: Refactor would_convert_to_git() to single arg 'path' Steffen Prohaska
2014-08-21 16:05 ` [PATCH v3 2/3] Introduce GIT_MMAP_LIMIT to allow testing expected mmap size Steffen Prohaska
2014-08-21 22:26   ` Junio C Hamano
2014-08-22 13:46     ` Steffen Prohaska
2014-08-22 15:57       ` Junio C Hamano
2014-08-22 16:31         ` Junio C Hamano [this message]
2014-08-24 16:03           ` Steffen Prohaska
2014-08-21 16:05 ` [PATCH v3 3/3] convert: Stream from fd to required clean filter instead of mmap Steffen Prohaska

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=xmqqiolkpjtq.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=john@keeping$(echo .)me.uk \
    --cc=pclouds@gmail$(echo .)com \
    --cc=peff@peff$(echo .)net \
    --cc=prohaska@zib$(echo .)de \
    --cc=schacon@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox