test-tool: Make it possible to disable memory caching
Disable memory caching in libiscsi if the environment variable LIBISCSI_CACHE_ALLOCATIONS has been set to zero. This makes Valgrind reports more meaningful. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This commit is contained in:
committed by
Ronnie Sahlberg
parent
d8de6531f8
commit
cf4076dba9
@@ -971,6 +971,11 @@ main(int argc, char *argv[])
|
||||
};
|
||||
int i, c;
|
||||
int opt_idx = 0;
|
||||
char *ca;
|
||||
|
||||
ca = getenv("LIBISCSI_CACHE_ALLOCATIONS");
|
||||
if (ca && atoi(ca) == 0)
|
||||
iscsi_set_cache_allocations(0);
|
||||
|
||||
sd = malloc(sizeof(struct scsi_device));
|
||||
memset(sd, '\0', sizeof(struct scsi_device));
|
||||
|
||||
Reference in New Issue
Block a user