mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
valgrind: don't eat mem with valgrind
When compiled with valgrind pool support - don't waste time with preallocation of memory - it just waste of CPU cycles to trace access to this memory. We also may get slightly better estimation about real memory usage during command processing.
This commit is contained in:
parent
f3e9ff7179
commit
d1be66ba37
@ -132,6 +132,8 @@ static void _touch_memory(void *mem, size_t size)
|
||||
|
||||
static void _allocate_memory(void)
|
||||
{
|
||||
#ifndef VALGRIND_POOL
|
||||
/* With Valgrind don't waste time in with preallocating memory */
|
||||
void *stack_mem, *temp_malloc_mem;
|
||||
struct rlimit limit;
|
||||
|
||||
@ -149,6 +151,7 @@ static void _allocate_memory(void)
|
||||
_touch_memory(_malloc_mem, _size_malloc);
|
||||
|
||||
free(temp_malloc_mem);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void _release_memory(void)
|
||||
|
Loading…
Reference in New Issue
Block a user