fix memory leak bugs

This commit is contained in:
崔一鸣
2018-09-07 17:42:57 +08:00
parent b6a2250786
commit b5a937bad6
10 changed files with 804 additions and 506 deletions

View File

@@ -25,7 +25,7 @@ struct _future_promise_debug
int fsid_latency;
int fsid_failed;
long long succ_times;
struct timespec create_time;
struct timespec create_time;
};
struct future
{
@@ -52,7 +52,7 @@ void future_promise_library_init(void)
{
return;
}
int value=0;
memset(&g_FP_instance,0,sizeof(g_FP_instance));
MESA_htable_handle htable = MESA_htable_born();
@@ -90,7 +90,7 @@ void future_promise_library_init(void)
}
struct promise * future_to_promise(struct future * f)
{
{
return (struct promise *) f;
}
struct field_get_set_args
@@ -116,7 +116,7 @@ static long field_get_set_cb(void * data, const uchar * key, uint size, void * u
field_id[1]=FS_register(args->fs_handle, FS_STYLE_FIELD, FS_CALC_SPEED,buff);
args->fsid_failed=field_id[1];
ret = MESA_htable_add(args->htable, key, size, (void*)field_id);
assert(ret>=0);
assert(ret>=0);
}
else
{
@@ -134,7 +134,7 @@ struct future * future_create(const char* symbol, future_success_cb * cb_success
p->f.cb_success = cb_success;
p->f.cb_failed = cb_failed;
strncpy(p->f.symbol,symbol,sizeof(p->f.symbol));
clock_gettime(CLOCK_MONOTONIC,&p->debug.create_time);
long cb_ret=0;
struct field_get_set_args args={.htable = g_FP_instance.name_table, .fs_handle = g_FP_instance.fs_handle};