[LTP] [PATCH v3 2/3] lib: rename ltp_clone_malloc to ltp_clone_alloc

Cyril Hrubis chrubis@suse.cz
Thu Jun 13 15:57:40 CEST 2019


Hi!
> > @@ -170,5 +170,5 @@ int ltp_clone_quick(unsigned long clone_flags, int
> > (*fn) (void *arg), void *arg)
> >  {
> >         size_t stack_size = getpagesize() * 6;
> >
> > -       return ltp_clone_malloc(clone_flags, fn, arg, stack_size);
> > +       return ltp_clone_alloc(clone_flags, fn, arg, stack_size);
> >  }
> >
> 
> There is another legacy problem maybe we need take care.
> 
> Any thought about how releasing the stack memory[1] after calling
> ltp_clone_quick() in a test?
> 
> [1] which allocated memory in ltp_clone_alloc().

Well, we can free the memory in ltp_clone_alloc() if the child runs in a
separate memory space, but if CLONE_VM was passed in flags there is no
way how to free the memory...

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list