[PATCH 16/30] Fix void* pointer arithmetic

Milan Broz <[email protected]>
Newsgroups dev.linux.lists.lvm-devel
Message-ID <[email protected]>
On 10/25/2010 10:24 AM, Zdenek Kabelac wrote:

>  static void _touch_memory(void *mem, size_t size)
>  {
>  	size_t pagesize = lvm_getpagesize();
> -	void *pos = mem;
> -	void *end = mem + size - sizeof(long);
> +	char *pos = mem;
> +	char *end = pos + size - sizeof(long);

And what about trash this "touch memory" code completely?

The whole idea of touching memory before locking is IMHO obsolete.

Locking memory should do this implicitly - can we prove that this
code has some effect on recent systems?

Milan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.