make ks_pool_free appear take double pointer

This commit is contained in:
Anthony Minessale
2016-12-15 20:16:10 -06:00
committed by Mike Jerris
parent 73e4c22255
commit d2f04e2133
20 changed files with 83 additions and 74 deletions

View File

@@ -84,7 +84,7 @@ int main(int argc, char **argv)
printf("FREE:\n");
status = ks_pool_safe_free(pool, str);
status = ks_pool_free(pool, &str);
if (status != KS_STATUS_SUCCESS) {
fprintf(stderr, "FREE ERR: [%s]\n", ks_pool_strerror(err));
exit(255);
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
printf("FREE OBJ:\n");
status = ks_pool_safe_free(pool, foo);
status = ks_pool_free(pool, &foo);
ok(status == KS_STATUS_SUCCESS);
if (status != KS_STATUS_SUCCESS) {
fprintf(stderr, "FREE OBJ ERR: [%s]\n", ks_pool_strerror(status));
@@ -181,7 +181,7 @@ int main(int argc, char **argv)
printf("FREE 2:\n");
status = ks_pool_free(pool, str);
status = ks_pool_free(pool, &str);
ok(status == KS_STATUS_SUCCESS);
if (status != KS_STATUS_SUCCESS) {
fprintf(stderr, "FREE2 ERR: [%s]\n", ks_pool_strerror(status));

View File

@@ -10,7 +10,7 @@ static void *test1_thread(ks_thread_t *thread, void *data)
while(ks_q_pop(q, &pop) == KS_STATUS_SUCCESS) {
//int *i = (int *)pop;
//printf("POP %d\n", *i);
ks_pool_free(thread->pool, pop);
ks_pool_free(thread->pool, &pop);
}
return NULL;
@@ -19,7 +19,7 @@ static void *test1_thread(ks_thread_t *thread, void *data)
static void do_flush(ks_q_t *q, void *ptr, void *flush_data)
{
ks_pool_t *pool = (ks_pool_t *)flush_data;
ks_pool_free(pool, ptr);
ks_pool_free(pool, &ptr);
}
@@ -104,7 +104,7 @@ static void *test2_thread(ks_thread_t *thread, void *data)
//int *i = (int *)pop;
//printf("%p POP %d\n", (void *)pthread_self(), *i);
popped++;
ks_pool_free(thread->pool, pop);
ks_pool_free(thread->pool, &pop);
} else if (status == KS_STATUS_INACTIVE) {
break;
} else if (t2->try && ks_q_size(t2->q)) {

View File

@@ -185,7 +185,7 @@ static void *thread_test_function_atatched(ks_thread_t *thread, void *data)
for (i = 0; i < LOOP_COUNT; i++) {
if (last_mem) {
ks_pool_safe_free(thread->pool, last_mem);
ks_pool_free(thread->pool, &last_mem);
}
mem = ks_pool_alloc(thread->pool, 1024);
last_mem = mem;
@@ -246,7 +246,7 @@ static void check_thread_priority(void)
ok( ks_thread_priority(thread_p) == KS_PRI_IMPORTANT );
end_todo;
ks_pool_free(pool, thread_p);
ks_pool_free(pool, &thread_p);
}
static void join_threads(void)