|
|
8a8cfb |
commit 5dab5eafb3dc2f72aaab911084d127d1af45a08c
|
|
|
8a8cfb |
Author: Florian Weimer <fweimer@redhat.com>
|
|
|
8a8cfb |
Date: Thu Aug 15 11:37:18 2019 +0200
|
|
|
8a8cfb |
|
|
|
8a8cfb |
malloc: Various cleanups for malloc/tst-mxfast
|
|
|
8a8cfb |
|
|
|
8a8cfb |
(cherry picked from commit f9769a239784772453d595bc2f4bed8739810e06)
|
|
|
8a8cfb |
|
|
|
8a8cfb |
diff --git a/malloc/Makefile b/malloc/Makefile
|
|
|
8a8cfb |
index bf9a53cb7c5ebacb..19c2a846ed8ce049 100644
|
|
|
8a8cfb |
--- a/malloc/Makefile
|
|
|
8a8cfb |
+++ b/malloc/Makefile
|
|
|
8a8cfb |
@@ -39,7 +39,6 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \
|
|
|
8a8cfb |
tst-malloc-too-large \
|
|
|
8a8cfb |
tst-malloc-stats-cancellation \
|
|
|
8a8cfb |
tst-tcfree1 tst-tcfree2 tst-tcfree3 \
|
|
|
8a8cfb |
- tst-mxfast \
|
|
|
8a8cfb |
|
|
|
8a8cfb |
tests-static := \
|
|
|
8a8cfb |
tst-interpose-static-nothread \
|
|
|
8a8cfb |
@@ -55,7 +54,7 @@ tests-internal += \
|
|
|
8a8cfb |
tst-dynarray-at-fail \
|
|
|
8a8cfb |
|
|
|
8a8cfb |
ifneq (no,$(have-tunables))
|
|
|
8a8cfb |
-tests += tst-malloc-usable-tunables
|
|
|
8a8cfb |
+tests += tst-malloc-usable-tunables tst-mxfast
|
|
|
8a8cfb |
tests-static += tst-malloc-usable-static-tunables
|
|
|
8a8cfb |
endif
|
|
|
8a8cfb |
|
|
|
8a8cfb |
diff --git a/malloc/tst-mxfast.c b/malloc/tst-mxfast.c
|
|
|
8a8cfb |
index 7a371d2f9d2f0005..7a7750bc71024bfb 100644
|
|
|
8a8cfb |
--- a/malloc/tst-mxfast.c
|
|
|
8a8cfb |
+++ b/malloc/tst-mxfast.c
|
|
|
8a8cfb |
@@ -1,5 +1,5 @@
|
|
|
8a8cfb |
/* Test that glibc.malloc.mxfast tunable works.
|
|
|
8a8cfb |
- Copyright (C) 2018, 2019 Free Software Foundation, Inc.
|
|
|
8a8cfb |
+ Copyright (C) 2019 Free Software Foundation, Inc.
|
|
|
8a8cfb |
This file is part of the GNU C Library.
|
|
|
8a8cfb |
|
|
|
8a8cfb |
The GNU C Library is free software; you can redistribute it and/or
|
|
|
8a8cfb |
@@ -21,14 +21,14 @@
|
|
|
8a8cfb |
the fast bins. */
|
|
|
8a8cfb |
|
|
|
8a8cfb |
#include <malloc.h>
|
|
|
8a8cfb |
-#include <assert.h>
|
|
|
8a8cfb |
+#include <support/check.h>
|
|
|
8a8cfb |
|
|
|
8a8cfb |
int
|
|
|
8a8cfb |
-do_test(void)
|
|
|
8a8cfb |
+do_test (void)
|
|
|
8a8cfb |
{
|
|
|
8a8cfb |
struct mallinfo m;
|
|
|
8a8cfb |
- char * volatile p1;
|
|
|
8a8cfb |
- char * volatile p2;
|
|
|
8a8cfb |
+ char *volatile p1;
|
|
|
8a8cfb |
+ char *volatile p2;
|
|
|
8a8cfb |
|
|
|
8a8cfb |
/* Arbitrary value; must be in default fastbin range. */
|
|
|
8a8cfb |
p1 = malloc (3);
|
|
|
8a8cfb |
@@ -36,10 +36,10 @@ do_test(void)
|
|
|
8a8cfb |
p2 = malloc (512);
|
|
|
8a8cfb |
free (p1);
|
|
|
8a8cfb |
|
|
|
8a8cfb |
- m = mallinfo();
|
|
|
8a8cfb |
+ m = mallinfo ();
|
|
|
8a8cfb |
|
|
|
8a8cfb |
/* This will fail if there are any blocks in the fastbins. */
|
|
|
8a8cfb |
- assert (m.smblks == 0);
|
|
|
8a8cfb |
+ TEST_COMPARE (m.smblks, 0);
|
|
|
8a8cfb |
|
|
|
8a8cfb |
/* To keep gcc happy. */
|
|
|
8a8cfb |
free (p2);
|