rados: Move array to heap. Prevent segfault when you use too-large a write size

This commit is contained in:
Greg Farnum 2009-11-18 10:13:29 -08:00
parent ba8aa58197
commit 30a057cf04

View File

@ -159,7 +159,7 @@ int aio_bench(Rados& rados, rados_pool_t pool, int secondsToRun,
Rados::AioCompletion* completions[concurrentios];
char* name[concurrentios];
bufferlist* contents[concurrentios];
char contentsChars[writeSize];
char* contentsChars = new char[writeSize];
double totalLatency = 0;
double minLatency=9999.0; // this better be higher than initial latency!
double maxLatency=0;
@ -331,6 +331,7 @@ int aio_bench(Rados& rados, rados_pool_t pool, int secondsToRun,
pthread_join(print_thread, NULL);
delete contentsChars;
delete data;
return 0;
}