diff --git a/c/xalloc/xalloc_test.c b/c/xalloc/xalloc_test.c index f7921a5..1fab1e4 100644 --- a/c/xalloc/xalloc_test.c +++ b/c/xalloc/xalloc_test.c @@ -41,6 +41,8 @@ int main(int argc, char *argv[]) p[i] = NULL; } + xclear(&p); + printf("Success, iterations = %lu, nobj = %lu\n", iterations, nobj); return EXIT_SUCCESS; diff --git a/c/zalloc/zalloc_test.c b/c/zalloc/zalloc_test.c index 2da738b..65828c1 100644 --- a/c/zalloc/zalloc_test.c +++ b/c/zalloc/zalloc_test.c @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) for (i = 0; i < iterations; i++) { idx = (size_t)(rand() % (int)nobj); sz = i; - p[idx] = zrealloc(p[idx], sz); + zrealloc_inplace(&p[idx], sz); if (sz && !p[idx]) { fprintf(stderr, "Alloc error at i = %lu\n", i); @@ -39,6 +39,8 @@ int main(int argc, char *argv[]) for (i = 0; i < nobj; i++) zclear(&p[i]); + zclear(&p); + printf("Success, iterations = %lu, nobj = %lu\n", iterations, nobj); return EXIT_SUCCESS; diff --git a/c/zalloc_ext/zalloc_ext_test.c b/c/zalloc_ext/zalloc_ext_test.c index 88097d2..2bb5b6a 100644 --- a/c/zalloc_ext/zalloc_ext_test.c +++ b/c/zalloc_ext/zalloc_ext_test.c @@ -35,6 +35,8 @@ int main() zptr4_str = zalloc_append32_str(zptr4_str, (((((('4' << 8) + '4') << 8) + '4') << 8) + '4')); puts(zptr4_str); zptr3 = zalloc_append64(zptr3, 3232423423423LLU); + zptr = zalloc_append_ptr(zptr, (void *)93842); + int64_t i64 = 1561; int i; for (i = 0; i < 8; i++) @@ -70,6 +72,7 @@ int main() zptr5 = zalloc_insert64(zptr5, 9874, 5478433443LU); zptr6_str = zalloc_insert64_str(zptr6_str, zalloc_size(zptr6_str) - 1, i64); puts(zptr6_str); + zptr = zalloc_insert_ptr(zptr, 8, (void *)93842); return EXIT_SUCCESS; }