Re: [PATCH v3 2/3] Introduce GIT_MMAP_LIMIT to allow testing expected mmap size

2014-08-24 Thread Steffen Prohaska
On Aug 22, 2014, at 6:31 PM, Junio C Hamano gits...@pobox.com wrote: Steffen Prohaska proha...@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 ...

Re: [PATCH v3 2/3] Introduce GIT_MMAP_LIMIT to allow testing expected mmap size

2014-08-22 Thread Steffen Prohaska
On Aug 22, 2014, at 12:26 AM, Junio C Hamano gits...@pobox.com wrote: Steffen Prohaska proha...@zib.de writes: Similar to testing expectations about malloc with GIT_ALLOC_LIMIT (see commit d41489), it can be useful to test expectations about mmap. This introduces a new environment

Re: [PATCH v3 2/3] Introduce GIT_MMAP_LIMIT to allow testing expected mmap size

2014-08-22 Thread Junio C Hamano
Steffen Prohaska proha...@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

Re: [PATCH v3 2/3] Introduce GIT_MMAP_LIMIT to allow testing expected mmap size

2014-08-22 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Steffen Prohaska proha...@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

[PATCH v3 2/3] Introduce GIT_MMAP_LIMIT to allow testing expected mmap size

2014-08-21 Thread Steffen Prohaska
Similar to testing expectations about malloc with GIT_ALLOC_LIMIT (see commit d41489), it can be useful to test expectations about mmap. This introduces a new environment variable GIT_MMAP_LIMIT to limit the largest allowed mmap length (in KB). xmmap() is modified to check the limit. Together

Re: [PATCH v3 2/3] Introduce GIT_MMAP_LIMIT to allow testing expected mmap size

2014-08-21 Thread Junio C Hamano
Steffen Prohaska proha...@zib.de writes: Similar to testing expectations about malloc with GIT_ALLOC_LIMIT (see commit d41489), it can be useful to test expectations about mmap. This introduces a new environment variable GIT_MMAP_LIMIT to limit the largest allowed mmap length (in KB).