X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-malloca.c;h=92c86f206c2f97db8dd08e2544032b0fe2a9b03d;hb=1bb384c44db25aef8f8b455cef22af32d8401abc;hp=02ac299402f5a2cf8c0cc5772d243d4fda8260ac;hpb=988b3d18308c977959941a443e566d8345085bd1;p=gnulib.git diff --git a/tests/test-malloca.c b/tests/test-malloca.c index 02ac29940..92c86f206 100644 --- a/tests/test-malloca.c +++ b/tests/test-malloca.c @@ -1,10 +1,10 @@ /* Test of safe automatic memory allocation. - Copyright (C) 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2009-2011 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Bruno Haible , 2005. */ @@ -28,7 +27,7 @@ do_allocation (int n) { void *ptr = malloca (n); freea (ptr); - ptr = safe_alloca (n); + safe_alloca (n); } void (*func) (int) = do_allocation; @@ -38,6 +37,9 @@ main () { int i; + /* This slows down malloc a lot. */ + unsetenv ("MALLOC_PERTURB_"); + /* Repeat a lot of times, to make sure there's no memory leak. */ for (i = 0; i < 50000; i++) {