chiark / gitweb /
@@@ tvec and tty mess
[mLib] / test / tvec-timeout.c
index 778673eadb9d6322ff0e12906f6989044e742430..e7b23b51fad1bbb31906e718d17525edd25d190b 100644 (file)
@@ -74,8 +74,10 @@ void tvec_timeoutsetup(struct tvec_state *tv, const struct tvec_env *env,
 
   reset(tc);
 
 
   reset(tc);
 
-  if (subenv && subenv->ctxsz) tc->subctx = x_alloc(tv->a, subenv->ctxsz);
-  else tc->subctx = 0;
+  if (subenv && subenv->ctxsz)
+    tc->subctx = pool_alloc(tv->p_group, subenv->ctxsz);
+  else
+    tc->subctx = 0;
   if (subenv && subenv->setup) subenv->setup(tv, subenv, tc, tc->subctx);
 }
 
   if (subenv && subenv->setup) subenv->setup(tv, subenv, tc, tc->subctx);
 }
 
@@ -247,7 +249,6 @@ void tvec_timeoutteardown(struct tvec_state *tv, void *ctx)
 
   /* Just call the subsidiary environment. */
   if (subenv && subenv->teardown) subenv->teardown(tv, tc->subctx);
 
   /* Just call the subsidiary environment. */
   if (subenv && subenv->teardown) subenv->teardown(tv, tc->subctx);
-  x_free(tv->a, tc->subctx);
 }
 
 /*----- That's all, folks -------------------------------------------------*/
 }
 
 /*----- That's all, folks -------------------------------------------------*/