From 5e3f383aec22e1b67cc7cb1eb0dcc0a6da60ae6d Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Fri, 28 Dec 2007 19:03:20 +0000 Subject: Set pool_test_malloc_free() to use malloc()/free() instead of new/delete since there is compilation error on Symbian with GCCE compiler. But this most likely will fail on run-time, so currently this test is broken for Symbian git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1643 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pjlib-test/pool_perf.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'pjlib/src') diff --git a/pjlib/src/pjlib-test/pool_perf.c b/pjlib/src/pjlib-test/pool_perf.c index c65b6e40..32487763 100644 --- a/pjlib/src/pjlib-test/pool_perf.c +++ b/pjlib/src/pjlib-test/pool_perf.c @@ -61,27 +61,29 @@ static int pool_test_pool() } /* Symbian doesn't have malloc()/free(), so we use new/delete instead */ -#if defined(PJ_SYMBIAN) && PJ_SYMBIAN != 0 - +//#if defined(PJ_SYMBIAN) && PJ_SYMBIAN != 0 +#if 0 static int pool_test_malloc_free() { int i; /* must be signed */ for (i=0; i= 0) - delete [] p[i], --i; - return -1; - } - *p[i] = '\0'; + p[i] = new char[sizes[i]]; + if (!p[i]) { + PJ_LOG(3,(THIS_FILE," error: malloc failed to allocate %d bytes", + sizes[i])); + --i; + while (i >= 0) { + delete [] p[i]; + --i; + } + return -1; + } + *p[i] = '\0'; } for (i=0; i