On 08/15/16 03:59, tang.junhui@xxxxxxxxxx wrote: > From: "tang.junhui" <tang.junhui@xxxxxxxxxx> > > Memroy API use mem_allocated to record the total size of used memory, > however, it's wrong to use size(p) as the length of freed memory in xfree(), > and memory may also be allocated by STRDUP() or REALLOC(), which is > not calculated into mem_allocated, so the total size of used memory is > not correctly. For these reasons, we removed these incorrectly code to keep > the code clean. Nice work. BTW, I think it's worth mentioning that this patch also fixes a data race. Without this patch the global variable mem_allocated is manipulated by multiple threads without using atomics and without serializing concurrent accesses. Bart. -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel