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 wrote: > Steffen Prohaska 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 re

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 writes: > Steffen Prohaska 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

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

2014-08-22 Thread Junio C Hamano
Steffen Prohaska 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/a

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 wrote: > Steffen Prohaska 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 li

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

2014-08-21 Thread Junio C Hamano
Steffen Prohaska 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). xmmap() is modif

[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 wi