| 863 | } |
| 864 | |
| 865 | static void mmap_limit_check(size_t length) |
| 866 | { |
| 867 | static size_t limit = 0; |
| 868 | if (!limit) { |
| 869 | limit = git_env_ulong("GIT_MMAP_LIMIT", 0); |
| 870 | if (!limit) |
| 871 | limit = SIZE_MAX; |
| 872 | } |
| 873 | if (length > limit) |
| 874 | die(_("attempting to mmap %"PRIuMAX" over limit %"PRIuMAX), |
| 875 | (uintmax_t)length, (uintmax_t)limit); |
| 876 | } |
| 877 | |
| 878 | void *xmmap_gently(void *start, size_t length, |
| 879 | int prot, int flags, int fd, off_t offset) |
no test coverage detected