/* $Id$ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono * * 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 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 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "test.h" #if INCLUDE_POOL_PERF_TEST #include #include #if !PJ_HAS_HIGH_RES_TIMER # error Need high resolution timer for this test. #endif #define THIS_FILE "test" #define LOOP 10 #define COUNT 1024 static unsigned sizes[COUNT]; static char *p[COUNT]; #define MIN_SIZE 4 #define MAX_SIZE 512 static unsigned total_size; static int pool_test_pool() { int i; pj_pool_t *pool = pj_pool_create(mem, NULL, total_size + 4*COUNT, 0, NULL); if (!pool) return -1; for (i=0; i= 0) { delete [] p[i]; --i; } return -1; } *p[i] = '\0'; } for (i=0; i= 0) free(p[i]), --i; return -1; } *p[i] = '\0'; } for (i=0; i