Re: [PATCH v5 02/15] read-cache: allow to keep mmap'd memory after reading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dave,

On Tue, 19 Apr 2016, David Turner wrote:

>  unmap:
> +	istate->mmap = NULL;
>  	munmap(mmap, mmap_size);
>  	die("index file corrupt");
>  }
> [...]
> @@ -1698,6 +1705,10 @@ int discard_index(struct index_state *istate)
>  	free(istate->cache);
>  	istate->cache = NULL;
>  	istate->cache_alloc = 0;
> +	if (istate->keep_mmap && istate->mmap) {
> +		munmap(istate->mmap, istate->mmap_size);
> +		istate->mmap = NULL;
> +	}
>  	discard_split_index(istate);

Just curious: any reason why the first hunk munmap()s after resetting the
field to NULL and the second hunk does it in the opposite order?

Ciao,
Dscho
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]