修复内存泄露
This commit is contained in:
20
cache/test/cache_evbase_benchmark.cpp
vendored
20
cache/test/cache_evbase_benchmark.cpp
vendored
@@ -320,7 +320,11 @@ static void* thread_transfer_cmd(void *arg)
|
||||
{
|
||||
object_store_update_frag_data(ctx, PUT_MEM_COPY, filecont.buf+(filecont.len-remain_len), remain_len);
|
||||
}
|
||||
object_store_update_end(ctx, pdata->filename, 256);
|
||||
if(object_store_update_end(ctx, pdata->filename, 256))
|
||||
{
|
||||
future_destroy(pdata->future);
|
||||
free(pdata);
|
||||
}
|
||||
break;
|
||||
|
||||
case METHOD_HEAD:
|
||||
@@ -343,7 +347,11 @@ static void* thread_transfer_cmd(void *arg)
|
||||
|
||||
pdata = (struct future_pdata *)malloc(sizeof(struct future_pdata));
|
||||
pdata->future = future_create(put_future_success, put_future_failed, pdata);
|
||||
object_store_upload_once_data(instance_asyn, pdata->future, PUT_MEM_FREE, filecont.buf, filecont.len, &putmeta, pdata->filename, 256);
|
||||
if(object_store_upload_once_data(instance_asyn, pdata->future, PUT_MEM_COPY, filecont.buf, filecont.len, &putmeta, pdata->filename, 256))
|
||||
{
|
||||
future_destroy(pdata->future);
|
||||
free(pdata);
|
||||
}
|
||||
break;
|
||||
case METHOD_PUTONCEEV:
|
||||
remain_len = filecont.len;
|
||||
@@ -365,7 +373,11 @@ static void* thread_transfer_cmd(void *arg)
|
||||
{
|
||||
evbuffer_add(evbuf, filecont.buf+(filecont.len-remain_len), remain_len);
|
||||
}
|
||||
object_store_upload_once_evbuf(instance_asyn, pdata->future, evbuf, &putmeta, pdata->filename, 256);
|
||||
if(object_store_upload_once_evbuf(instance_asyn, pdata->future, evbuf, &putmeta, pdata->filename, 256))
|
||||
{
|
||||
future_destroy(pdata->future);
|
||||
free(pdata);
|
||||
}
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
@@ -389,7 +401,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if(argc != 6)
|
||||
{
|
||||
printf("USAGE: %s <method,1-GET,2-PUT> <file> <threads> <total_num> <limit_session_num>\n", argv[0]);
|
||||
printf("USAGE: %s <method,1-GET,2-PUT,5-PUTONCE> <file> <threads> <total_num> <limit_session_num>\n", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user