<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 13, 2019 at 3:25 PM Jan Stancek <<a href="mailto:jstancek@redhat.com">jstancek@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">There are no users outside of lib.<br>
<br>
Signed-off-by: Jan Stancek <<a href="mailto:jstancek@redhat.com" target="_blank">jstancek@redhat.com</a>><br>
---<br>
include/tst_clone.h | 2 +-<br>
lib/cloner.c | 8 ++++----<br>
2 files changed, 5 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/include/tst_clone.h b/include/tst_clone.h<br>
index 786cee5d1209..fd52097e2072 100644<br>
--- a/include/tst_clone.h<br>
+++ b/include/tst_clone.h<br>
@@ -29,7 +29,7 @@ int ltp_clone(unsigned long flags, int (*fn)(void *arg), void *arg,<br>
size_t stack_size, void *stack);<br>
int ltp_clone7(unsigned long flags, int (*fn)(void *arg), void *arg,<br>
size_t stack_size, void *stack, ...);<br>
-int ltp_clone_malloc(unsigned long clone_flags, int (*fn)(void *arg),<br>
+int ltp_clone_alloc(unsigned long clone_flags, int (*fn)(void *arg),<br>
void *arg, size_t stacksize);<br>
int ltp_clone_quick(unsigned long clone_flags, int (*fn)(void *arg),<br>
void *arg);<br>
diff --git a/lib/cloner.c b/lib/cloner.c<br>
index cf37184aa22a..8469745d004b 100644<br>
--- a/lib/cloner.c<br>
+++ b/lib/cloner.c<br>
@@ -135,11 +135,11 @@ void *ltp_alloc_stack(size_t size)<br>
}<br>
<br>
/*<br>
- * ltp_clone_malloc: also does the memory allocation for clone with a<br>
+ * ltp_clone_alloc: also does the memory allocation for clone with a<br>
* caller-specified size.<br>
*/<br>
int<br>
-ltp_clone_malloc(unsigned long clone_flags, int (*fn) (void *arg), void *arg,<br>
+ltp_clone_alloc(unsigned long clone_flags, int (*fn) (void *arg), void *arg,<br>
size_t stack_size)<br>
{<br>
void *stack;<br>
@@ -162,7 +162,7 @@ ltp_clone_malloc(unsigned long clone_flags, int (*fn) (void *arg), void *arg,<br>
}<br>
<br>
/*<br>
- * ltp_clone_quick: calls ltp_clone_malloc with predetermined stack size.<br>
+ * ltp_clone_quick: calls ltp_clone_alloc with predetermined stack size.<br>
* Experience thus far suggests that one page is often insufficient,<br>
* while 6*getpagesize() seems adequate.<br>
*/<br>
@@ -170,5 +170,5 @@ int ltp_clone_quick(unsigned long clone_flags, int (*fn) (void *arg), void *arg)<br>
{<br>
size_t stack_size = getpagesize() * 6;<br>
<br>
- return ltp_clone_malloc(clone_flags, fn, arg, stack_size);<br>
+ return ltp_clone_alloc(clone_flags, fn, arg, stack_size);<br>
}<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">There is another legacy problem maybe we need take care.</div><div class="gmail_default" style="font-size:small"><br></div><div><div class="gmail_default" style="font-size:small">Any thought about how releasing the stack memory[1] after calling ltp_clone_quick() in a test?</div></div></div><div><br></div><div><div class="gmail_default" style="font-size:small">[1] which allocated memory in ltp_clone_alloc().</div></div><div class="gmail_default" style="font-size:small"><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>